OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 // Based on: https://hg.mozilla.org/mozilla-central/file/d0c3168c3c47/js/src/jit
-test/tests/collections/Array-of-length-setter-2.js |
| 6 |
| 7 // Flags: --harmony-arrays |
| 8 |
| 9 |
| 10 // Array.of does a strict assignment to the new object's .length. |
| 11 |
| 12 // The assignment is strict even if the code we're calling from is not strict. |
| 13 |
| 14 function Empty() {} |
| 15 Empty.of = Array.of; |
| 16 Object.defineProperty(Empty.prototype, "length", {get: function() { return 0; }}
); |
| 17 |
| 18 var nothing = new Empty; |
| 19 nothing.length = 2; // no exception; this is not a strict mode assignment |
OLD | NEW |