Index: test/mjsunit/es6/array-of-length-setter-2.js |
diff --git a/test/mjsunit/es6/array-of-length-setter-2.js b/test/mjsunit/es6/array-of-length-setter-2.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43538387ce187f1bf46d0c324f74dd504dab20eb |
--- /dev/null |
+++ b/test/mjsunit/es6/array-of-length-setter-2.js |
@@ -0,0 +1,19 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Based on: https://hg.mozilla.org/mozilla-central/file/d0c3168c3c47/js/src/jit-test/tests/collections/Array-of-length-setter-2.js |
+ |
+// Flags: --harmony-arrays |
+ |
+ |
+// Array.of does a strict assignment to the new object's .length. |
+ |
+// The assignment is strict even if the code we're calling from is not strict. |
+ |
+function Empty() {} |
+Empty.of = Array.of; |
+Object.defineProperty(Empty.prototype, "length", {get: function() { return 0; }}); |
+ |
+var nothing = new Empty; |
+nothing.length = 2; // no exception; this is not a strict mode assignment |