Index: test/mjsunit/es6/array-of-1.js |
diff --git a/test/mjsunit/es6/array-of-1.js b/test/mjsunit/es6/array-of-1.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..493d2640761b29a470f9593a521ffed41cc8b1e7 |
--- /dev/null |
+++ b/test/mjsunit/es6/array-of-1.js |
@@ -0,0 +1,24 @@ |
+// 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-1.js |
+ |
+// Flags: --harmony-arrays |
+ |
+ |
+// Array.of makes real arrays. |
+ |
+function check(a) { |
+ assertEquals(Object.getPrototypeOf(a), Array.prototype); |
+ assertEquals(Array.isArray(a), true); |
+ a[9] = 9; |
+ assertEquals(a.length, 10); |
+} |
+ |
+ |
+check(Array.of()); |
+check(Array.of(0)); |
+check(Array.of(0, 1, 2)); |
+var f = Array.of; |
+check(f()); |