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

Side by Side Diff: test/webkit/class-syntax-super.js

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: rebase Created 4 years 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
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 1. Redistributions of source code must retain the above copyright 7 // 1. Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // 2. Redistributions in binary form must reproduce the above copyright 9 // 2. Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the 10 // notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 shouldThrow('(new x).method2()', '"ReferenceError: Unsupported reference to \'su per\'"'); 71 shouldThrow('(new x).method2()', '"ReferenceError: Unsupported reference to \'su per\'"');
72 shouldBeTrue('new (class { constructor() { return undefined; } }) instanceof Obj ect'); 72 shouldBeTrue('new (class { constructor() { return undefined; } }) instanceof Obj ect');
73 shouldBeTrue('new (class { constructor() { return 1; } }) instanceof Object'); 73 shouldBeTrue('new (class { constructor() { return 1; } }) instanceof Object');
74 shouldThrow('new (class extends Base { constructor() { return undefined } })'); 74 shouldThrow('new (class extends Base { constructor() { return undefined } })');
75 shouldBeTrue('new (class extends Base { constructor() { super(); return undefine d } }) instanceof Object'); 75 shouldBeTrue('new (class extends Base { constructor() { super(); return undefine d } }) instanceof Object');
76 shouldBe('x = { }; new (class extends Base { constructor() { return x } });', 'x '); 76 shouldBe('x = { }; new (class extends Base { constructor() { return x } });', 'x ');
77 shouldBeFalse('x instanceof Base'); 77 shouldBeFalse('x instanceof Base');
78 shouldThrow('new (class extends Base { constructor() { } })', '"ReferenceError: this is not defined"'); 78 shouldThrow('new (class extends Base { constructor() { } })', '"ReferenceError: this is not defined"');
79 shouldThrow('new (class extends Base { constructor() { return 1; } })', '"TypeEr ror: Derived constructors may only return object or undefined"'); 79 shouldThrow('new (class extends Base { constructor() { return 1; } })', '"TypeEr ror: Derived constructors may only return object or undefined"');
80 shouldThrow('new (class extends null { constructor() { return undefined } })'); 80 shouldThrow('new (class extends null { constructor() { return undefined } })');
81 shouldThrow('new (class extends null { constructor() { super(); return undefined } })', '"TypeError: super is not a constructor"'); 81 shouldThrow('new (class extends null { constructor() { super(); return undefined } })', '"TypeError: Super constructor null of anonymous class is not a construc tor"');
82 shouldBe('x = { }; new (class extends null { constructor() { return x } });', 'x '); 82 shouldBe('x = { }; new (class extends null { constructor() { return x } });', 'x ');
83 shouldBeTrue('x instanceof Object'); 83 shouldBeTrue('x instanceof Object');
84 shouldThrow('new (class extends null { constructor() { } })', '"ReferenceError: this is not defined"'); 84 shouldThrow('new (class extends null { constructor() { } })', '"ReferenceError: this is not defined"');
85 shouldThrow('new (class extends null { constructor() { return 1; } })', '"TypeEr ror: Derived constructors may only return object or undefined"'); 85 shouldThrow('new (class extends null { constructor() { return 1; } })', '"TypeEr ror: Derived constructors may only return object or undefined"');
86 shouldThrow('new (class extends null { constructor() { super() } })', '"TypeErro r: super is not a constructor"'); 86 shouldThrow('new (class extends null { constructor() { super() } })', '"TypeErro r: Super constructor null of anonymous class is not a constructor"');
87 shouldThrow('new (class { constructor() { super() } })', '"SyntaxError: \'super\ ' keyword unexpected here"'); 87 shouldThrow('new (class { constructor() { super() } })', '"SyntaxError: \'super\ ' keyword unexpected here"');
88 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe cted here"'); 88 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe cted here"');
89 shouldThrow('new (class extends Object { constructor() { function x() { super() } } })', '"SyntaxError: \'super\' keyword unexpected here"'); 89 shouldThrow('new (class extends Object { constructor() { function x() { super() } } })', '"SyntaxError: \'super\' keyword unexpected here"');
90 shouldThrow('new (class extends Object { constructor() { function x() { super.me thod } } })', '"SyntaxError: \'super\' keyword unexpected here"'); 90 shouldThrow('new (class extends Object { constructor() { function x() { super.me thod } } })', '"SyntaxError: \'super\' keyword unexpected here"');
91 shouldThrow('function x() { super.method(); }', '"SyntaxError: \'super\' keyword unexpected here"'); 91 shouldThrow('function x() { super.method(); }', '"SyntaxError: \'super\' keyword unexpected here"');
92 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe cted here"'); 92 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe cted here"');
93 93
94 var successfullyParsed = true; 94 var successfullyParsed = true;
OLDNEW
« no previous file with comments | « test/webkit/class-syntax-extends-expected.txt ('k') | test/webkit/class-syntax-super-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698