Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1 | // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | var throwTypeErrorFunction = |
| 6 | Object.getOwnPropertyDescriptor(Function.prototype, 'arguments').get; |
| 7 | |
| 8 | assertFalse( |
| 9 | Object.prototype.hasOwnProperty.call(throwTypeErrorFunction, 'name')); |
| 10 | assertThrows(function() { |
| 11 | 'use strict'; |
| 12 | throwTypeErrorFunction.name = 'foo'; |
| 13 | }, TypeError); |
| 14 | |
| 15 | var lengthDesc = |
| 16 | Object.getOwnPropertyDescriptor(throwTypeErrorFunction, 'length'); |
| 17 | assertFalse(lengthDesc.configurable, 'configurable'); |
| 18 | assertFalse(lengthDesc.enumerable, 'enumerable'); |
| 19 | assertFalse(lengthDesc.writable, 'writable'); |
| 20 | assertThrows(function() { |
| 21 | 'use strict'; |
| 22 | throwTypeErrorFunction.length = 42; |
| 23 | }, TypeError); |
| 24 | |
| 25 | assertTrue(Object.isFrozen(throwTypeErrorFunction)); |