mirror of https://github.com/lukechilds/node.git
Browse Source
Original commit message: Rewrite scopes of non-simple default arguments Default parameters have additional declaration block scopes inserted around them when something in the function scope calls eval. This patch sets the parent scope of the expressions introduced due to those defaults to the new block scope. R=adamk BUG=chromium:616386 Review-Url: https://codereview.chromium.org/2077283004 Cr-Commit-Position: refs/heads/master@{#37198} PR-URL: https://github.com/nodejs/node-private/pull/80 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>v6.x
Rod Vagg
8 years ago
4 changed files with 41 additions and 1 deletions
@ -0,0 +1,10 @@ |
|||
// Copyright 2016 the V8 project authors. All rights reserved.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
|||
// found in the LICENSE file.
|
|||
|
|||
// Flags: --no-lazy
|
|||
|
|||
assertEquals(0, ((y = (function(a2) { bbbb = a2 }), bbbb = eval('1')) => {y(0); return bbbb})()) |
|||
assertEquals(0, (({y = (function(a2) { bbbb = a2 }), bbbb = eval('1')} = {}) => {y(0); return bbbb})()) |
|||
assertEquals(0, (function (y = (function(a2) { bbbb = a2 }), bbbb = eval('1')) {y(0); return bbbb})()) |
|||
assertEquals(0, (function ({y = (function(a2) { bbbb = a2 }), bbbb = eval('1')} = {}) {y(0); return bbbb})()) |
Loading…
Reference in new issue