Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: test/mjsunit/es6/array-of-surfaces.js

Issue 364853009: Implement ES6 Array.of() (Closed) Base URL: https://github.com/v8/v8@master
Patch Set: Added comment 'TODO: Implement IsConstructor' Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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-surfaces.js
6
7 // Flags: --harmony-arrays
8
9
10 // Check superficial features of Array.of.
11
12 var desc = Object.getOwnPropertyDescriptor(Array, "of");
13
14 assertEquals(desc.configurable, true);
15 assertEquals(desc.enumerable, false);
16 assertEquals(desc.writable, true);
17 assertEquals(Array.of.length, 0);
18 assertThrows(function() { new Array.of() }, TypeError); // not a constructor
19
20 // When the this-value passed in is not a constructor, the result is an array.
21 [undefined, null, false, "cow"].forEach(function(val) {
22 assertEquals(Array.isArray(Array.of(val)), true);
23 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698