Index: test/mjsunit/es6/array-of-surfaces.js |
diff --git a/test/mjsunit/es6/array-of-surfaces.js b/test/mjsunit/es6/array-of-surfaces.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c37808e9ff696744edef17f57e0aa5d64a3ccd46 |
--- /dev/null |
+++ b/test/mjsunit/es6/array-of-surfaces.js |
@@ -0,0 +1,23 @@ |
+// 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-surfaces.js |
+ |
+// Flags: --harmony-arrays |
+ |
+ |
+// Check superficial features of Array.of. |
+ |
+var desc = Object.getOwnPropertyDescriptor(Array, "of"); |
+ |
+assertEquals(desc.configurable, true); |
+assertEquals(desc.enumerable, false); |
+assertEquals(desc.writable, true); |
+assertEquals(Array.of.length, 0); |
+assertThrows(function() { new Array.of() }, TypeError); // not a constructor |
+ |
+// When the this-value passed in is not a constructor, the result is an array. |
+[undefined, null, false, "cow"].forEach(function(val) { |
+ assertEquals(Array.isArray(Array.of(val)), true); |
+}); |