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

Side by Side Diff: test/mjsunit/strong/destructuring.js

Issue 1234213004: [parser] use-strict directives in function body affect init block (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 unified diff | Download patch
« src/parser.cc ('K') | « src/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // Flags: --harmony-destructuring --harmony-computed-property-names
6 // Flags: --harmony-arrow-functions --strong-mode --allow-natives-syntax
7
8 (function() {
9 function f({ x = function() { return []; } }) { "use strong"; return x(); }
10 var a = f({ x: undefined });
caitp (gmail) 2015/07/15 20:35:44 this move kind of makes destructuring initializers
rossberg 2015/07/16 12:53:47 Not sure I understand. What's not good? Btw, lang
caitp (gmail) 2015/07/16 13:03:57 It's okay for the VM, but having to fill out each
rossberg 2015/07/16 13:21:05 Ah, I see. Yes, that shouldn't throw in strong mod
11 assertTrue(%IsStrong(a));
12
13 function weakf({ x = function() { return []; } }) { return x(); }
14 a = weakf({});
15 assertFalse(%IsStrong(a));
16
17 function outerf() { return []; }
18 function f2({ x = outerf }) { "use strong"; return x(); }
19 a = f2({ x: undefined });
20 assertFalse(%IsStrong(a));
21 })();
OLDNEW
« src/parser.cc ('K') | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698