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

Unified Diff: test/mjsunit/harmony/destructuring.js

Issue 1571793002: Reland of Ship ES2015 sloppy-mode function hoisting, let, class (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/harmony/destructuring.js
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js
index 984efb00163330fecfd4a5404cd147e97e2fbd56..50f27857ec04ce302dacb2ab63139ac27167f61c 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -991,8 +991,9 @@
function f20({x}) { function x() { return 2 }; return x(); }
assertEquals(2, f20({x: 1}));
+ // Function hoisting is blocked by the conflicting x declaration
function f21({x}) { { function x() { return 2 } } return x(); }
- assertEquals(2, f21({x: 1}));
+ assertThrows(() => f21({x: 1}), TypeError);
var g1 = ({x}) => { var x = 2; return x };
assertEquals(2, g1({x: 1}));
@@ -1025,7 +1026,7 @@
var g20 = ({x}) => { function x() { return 2 }; return x(); }
assertEquals(2, g20({x: 1}));
var g21 = ({x}) => { { function x() { return 2 } } return x(); }
- assertEquals(2, g21({x: 1}));
+ assertThrows(() => g21({x: 1}), TypeError);
assertThrows("'use strict'; function f(x) { let x = 0; }; f({});", SyntaxError);
assertThrows("'use strict'; function f({x}) { let x = 0; }; f({});", SyntaxError);
« no previous file with comments | « test/mjsunit/harmony/classes-derived-return-type.js ('k') | test/mjsunit/harmony/regress/regress-crbug-451770.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698