tests/auto/qml/ecmascripttests/test262/test/language/directive-prologue/10.1.1-26-s.js
raw symbols SCIP| 1 | // Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | es5id: 10.1.1-26-s |
| 6 | description: > |
| 7 | Strict Mode - Function code of Accessor PropertyAssignment |
| 8 | contains Use Strict Directive which appears at the start of the |
| 9 | block(setter) |
| 10 | flags: [noStrict] |
| 11 | ---*/ |
| 12 | |
| 13 | var data = "data"; |
| 14 | |
| 15 | assert.throws(SyntaxError, function() { |
| 16 | var obj = {}; |
| 17 | Object.defineProperty(obj, "accProperty", { |
| 18 | set: function (value) { |
| 19 | "use strict"; |
| 20 | eval("var public = 1;"); |
| 21 | data = value; |
| 22 | } |
| 23 | }); |
| 24 | |
| 25 | obj.accProperty = "overrideData"; |
| 26 | }); |
| 27 | |
| 28 | assert.sameValue(data, "data", 'data unchanged'); |