OLD | NEW |
---|---|
(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 })(); | |
OLD | NEW |