| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 shouldThrow('(new x).method2()', '"ReferenceError: Unsupported reference to \'su
per\'"'); | 73 shouldThrow('(new x).method2()', '"ReferenceError: Unsupported reference to \'su
per\'"'); |
| 74 shouldBeTrue('new (class { constructor() { return undefined; } }) instanceof Obj
ect'); | 74 shouldBeTrue('new (class { constructor() { return undefined; } }) instanceof Obj
ect'); |
| 75 shouldBeTrue('new (class { constructor() { return 1; } }) instanceof Object'); | 75 shouldBeTrue('new (class { constructor() { return 1; } }) instanceof Object'); |
| 76 shouldThrow('new (class extends Base { constructor() { return undefined } })'); | 76 shouldThrow('new (class extends Base { constructor() { return undefined } })'); |
| 77 shouldBeTrue('new (class extends Base { constructor() { super(); return undefine
d } }) instanceof Object'); | 77 shouldBeTrue('new (class extends Base { constructor() { super(); return undefine
d } }) instanceof Object'); |
| 78 shouldBe('x = { }; new (class extends Base { constructor() { return x } });', 'x
'); | 78 shouldBe('x = { }; new (class extends Base { constructor() { return x } });', 'x
'); |
| 79 shouldBeFalse('x instanceof Base'); | 79 shouldBeFalse('x instanceof Base'); |
| 80 shouldThrow('new (class extends Base { constructor() { } })', '"ReferenceError:
this is not defined"'); | 80 shouldThrow('new (class extends Base { constructor() { } })', '"ReferenceError:
this is not defined"'); |
| 81 shouldThrow('new (class extends Base { constructor() { return 1; } })', '"TypeEr
ror: Derived constructors may only return object or undefined"'); | 81 shouldThrow('new (class extends Base { constructor() { return 1; } })', '"TypeEr
ror: Derived constructors may only return object or undefined"'); |
| 82 shouldThrow('new (class extends null { constructor() { return undefined } })'); | 82 shouldThrow('new (class extends null { constructor() { return undefined } })'); |
| 83 shouldThrow('new (class extends null { constructor() { super(); return undefined
} })', '"TypeError: function () {} is not a constructor"'); | 83 shouldThrow('new (class extends null { constructor() { super(); return undefined
} })', '"TypeError: super is not a constructor"'); |
| 84 shouldBe('x = { }; new (class extends null { constructor() { return x } });', 'x
'); | 84 shouldBe('x = { }; new (class extends null { constructor() { return x } });', 'x
'); |
| 85 shouldBeTrue('x instanceof Object'); | 85 shouldBeTrue('x instanceof Object'); |
| 86 shouldThrow('new (class extends null { constructor() { } })', '"ReferenceError:
this is not defined"'); | 86 shouldThrow('new (class extends null { constructor() { } })', '"ReferenceError:
this is not defined"'); |
| 87 shouldThrow('new (class extends null { constructor() { return 1; } })', '"TypeEr
ror: Derived constructors may only return object or undefined"'); | 87 shouldThrow('new (class extends null { constructor() { return 1; } })', '"TypeEr
ror: Derived constructors may only return object or undefined"'); |
| 88 shouldThrow('new (class extends null { constructor() { super() } })', '"TypeErro
r: function () {} is not a constructor"'); | 88 shouldThrow('new (class extends null { constructor() { super() } })', '"TypeErro
r: super is not a constructor"'); |
| 89 shouldThrow('new (class { constructor() { super() } })', '"SyntaxError: \'super\
' keyword unexpected here"'); | 89 shouldThrow('new (class { constructor() { super() } })', '"SyntaxError: \'super\
' keyword unexpected here"'); |
| 90 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe
cted here"'); | 90 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe
cted here"'); |
| 91 shouldThrow('new (class extends Object { constructor() { function x() { super()
} } })', '"SyntaxError: \'super\' keyword unexpected here"'); | 91 shouldThrow('new (class extends Object { constructor() { function x() { super()
} } })', '"SyntaxError: \'super\' keyword unexpected here"'); |
| 92 shouldThrow('new (class extends Object { constructor() { function x() { super.me
thod } } })', '"SyntaxError: \'super\' keyword unexpected here"'); | 92 shouldThrow('new (class extends Object { constructor() { function x() { super.me
thod } } })', '"SyntaxError: \'super\' keyword unexpected here"'); |
| 93 shouldThrow('function x() { super.method(); }', '"SyntaxError: \'super\' keyword
unexpected here"'); | 93 shouldThrow('function x() { super.method(); }', '"SyntaxError: \'super\' keyword
unexpected here"'); |
| 94 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe
cted here"'); | 94 shouldThrow('function x() { super(); }', '"SyntaxError: \'super\' keyword unexpe
cted here"'); |
| 95 | 95 |
| 96 var successfullyParsed = true; | 96 var successfullyParsed = true; |
| OLD | NEW |