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

Unified Diff: test/webkit/class-syntax-default-constructor.js

Issue 1109783003: Import JSC class tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 5 years, 8 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/webkit/class-syntax-default-constructor.js
diff --git a/test/webkit/dfg-inline-arguments-become-double.js b/test/webkit/class-syntax-default-constructor.js
similarity index 63%
copy from test/webkit/dfg-inline-arguments-become-double.js
copy to test/webkit/class-syntax-default-constructor.js
index b7db7ec002f31e92cf82c6f8b5d23f269a7da83c..841afddadcc374eaae10ac8d0be9beb6de828402 100644
--- a/test/webkit/dfg-inline-arguments-become-double.js
+++ b/test/webkit/class-syntax-default-constructor.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -21,34 +21,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-description(
-"This tests that inlining preserves function.arguments functionality if the arguments are reassigned to refer to an int32."
-);
+// Flags: --harmony-sloppy
-function foo() {
- return bar.arguments;
-}
+description('Tests for ES6 class syntax default constructor');
-function bar(a,b,c) {
- b = 42.5;
- return foo(a,b,c);
-}
+class A { };
+class B extends A { };
-function baz(a,b,c) {
- return bar(a,b,c);
-}
-
-function argsToStr(args) {
- var str = args + ": ";
- for (var i = 0; i < args.length; ++i) {
- if (i)
- str += ", ";
- str += args[i];
- }
- return str;
-}
-
-for (var __i = 0; __i < 200; ++__i)
- shouldBe("argsToStr(baz(\"a\" + __i, \"b\" + __i, \"c\" + __i))", "\"[object Arguments]: a" + __i + ", 42.5, c" + __i + "\"");
+shouldBeTrue('new A instanceof A');
+shouldThrow('A()', '"TypeError: Class constructors cannot be invoked without \'new\'"');
+shouldBeTrue('A.prototype.constructor instanceof Function');
+shouldBe('A.prototype.constructor.name', '"A"');
+shouldBeTrue('new B instanceof A; new B instanceof A');
+shouldThrow('B()', '"TypeError: Class constructors cannot be invoked without \'new\'"');
+shouldBe('B.prototype.constructor.name', '"B"');
+shouldBeTrue('A !== B');
+shouldBeTrue('A.prototype.constructor !== B.prototype.constructor');
+shouldBe('new (class extends (class { constructor(a, b) { return [a, b]; } }) {})(1, 2)', '[1, 2]');
var successfullyParsed = true;
« no previous file with comments | « test/webkit/class-syntax-declaration-expected.txt ('k') | test/webkit/class-syntax-default-constructor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698