Debian Codegraph @

js/src/tests/test262/language/expressions/assignment/11.13.1-2-s-strict.js

raw
1 'use strict';
2 // Copyright (c) 2012 Ecma International. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 es5id: 11.13.1-2-s
7 description: >
8 Strict Mode - TypeError is thrown if The LeftHandSide is a
9 reference to an accessor property with the attribute value
10 {[[Set]]:undefined} under strict mode
11 flags: [onlyStrict]
12 ---*/
13
14 var obj = {};
15 Object.defineProperty(obj, "prop", {
16 get: function () {
17 return 11;
18 },
19 set: undefined,
20 enumerable: true,
21 configurable: true
22 });
23 assert.throws(TypeError, function() {
24 obj.prop = 20;
25 });
26 assert.sameValue(obj.prop, 11, 'obj.prop');
27
28 reportCompare(0, 0);