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

Unified Diff: test/mjsunit/es6/array-of-generic-2.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 side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/es6/array-of-generic-2.js
diff --git a/test/mjsunit/es6/array-of-generic-2.js b/test/mjsunit/es6/array-of-generic-2.js
new file mode 100644
index 0000000000000000000000000000000000000000..777ccf63f5d0d7bc6ab2c3afba96a39128f10d4c
--- /dev/null
+++ b/test/mjsunit/es6/array-of-generic-2.js
@@ -0,0 +1,22 @@
+// 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-generic-2.js
+
+// Flags: --harmony-arrays
+
+
+// Array.of passes the number of arguments to the constructor it calls.
+
+var hits = 0;
+
+function Herd(n) {
+ assertEquals(arguments.length, 1);
+ assertEquals(n, 5);
+ hits++;
+}
+
+Herd.of = Array.of;
+Herd.of("sheep", "cattle", "elephants", "whales", "seals");
+assertEquals(hits, 1);

Powered by Google App Engine
This is Rietveld 408576698