mirror of https://github.com/lukechilds/node.git
Browse Source
Original commit message: Don't treat catch scopes as possibly-shadowing for sloppy eval Scope analysis is over-conservative when treating variable resolutions as possibly-shadowed by a sloppy eval. In the attached bug, this comes into play since catch scopes have different behavior with respect to the "calls eval" in eager vs lazy compilation (in the latter, they are never marked as "calls eval" because CatchContexts don't have an associated ScopeInfo). This patch changes the scope-type check to also eliminate a few other cases where shadowing isn't possible, such as non-declaration block scopes. BUG=chromium:608279 LOG=n Committed: https://crrev.com/75f2d65f003ebb22815489e9970913ba37234f1b Cr-Commit-Position: refs/heads/master@{#36046} Fixes: #12308 PR-URL: https://github.com/nodejs/node/pull/12535 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com>v6.x
committed by
Myles Borins
3 changed files with 24 additions and 3 deletions
@ -0,0 +1,18 @@ |
|||||
|
// 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: --always-opt --no-lazy
|
||||
|
|
||||
|
function __f_38() { |
||||
|
try { |
||||
|
throw 0; |
||||
|
} catch (e) { |
||||
|
eval(); |
||||
|
var __v_38 = { a: 'hest' }; |
||||
|
__v_38.m = function () { return __v_38.a; }; |
||||
|
} |
||||
|
return __v_38; |
||||
|
} |
||||
|
var __v_40 = __f_38(); |
||||
|
__v_40.m(); |
Loading…
Reference in new issue