| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e7e83f6 commit cd78a2b
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 5 | |
| 12 | 12 | #define V8_MINOR_VERSION 1 | |
| 13 | 13 | #define V8_BUILD_NUMBER 281 | |
| 14 | - #define V8_PATCH_LEVEL 100 | ||
| 14 | + #define V8_PATCH_LEVEL 101 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1083,12 +1083,15 @@ Variable* Scope::LookupRecursive(VariableProxy* proxy, | |||
| 1083 | 1083 | if (var != NULL && proxy->is_assigned()) var->set_maybe_assigned(); | |
| 1084 | 1084 | *binding_kind = DYNAMIC_LOOKUP; | |
| 1085 | 1085 | return NULL; | |
| 1086 | - } else if (calls_sloppy_eval() && !is_script_scope() && | ||
| 1087 | - name_can_be_shadowed) { | ||
| 1086 | + } else if (calls_sloppy_eval() && is_declaration_scope() && | ||
| 1087 | + !is_script_scope() && name_can_be_shadowed) { | ||
| 1088 | 1088 | // A variable binding may have been found in an outer scope, but the current | |
| 1089 | 1089 | // scope makes a sloppy 'eval' call, so the found variable may not be | |
| 1090 | 1090 | // the correct one (the 'eval' may introduce a binding with the same name). | |
| 1091 | 1091 | // In that case, change the lookup result to reflect this situation. | |
| 1092 | + // Only scopes that can host var bindings (declaration scopes) need be | ||
| 1093 | + // considered here (this excludes block and catch scopes), and variable | ||
| 1094 | + // lookups at script scope are always dynamic. | ||
| 1092 | 1095 | if (*binding_kind == BOUND) { | |
| 1093 | 1096 | *binding_kind = BOUND_EVAL_SHADOWED; | |
| 1094 | 1097 | } else if (*binding_kind == UNBOUND) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 1 | + // Copyright 2016 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: --always-opt --no-lazy | ||
| 6 | + | ||
| 7 | + function __f_38() { | ||
| 8 | + try { | ||
| 9 | + throw 0; | ||
| 10 | + } catch (e) { | ||
| 11 | + eval(); | ||
| 12 | + var __v_38 = { a: 'hest' }; | ||
| 13 | + __v_38.m = function () { return __v_38.a; }; | ||
| 14 | + } | ||
| 15 | + return __v_38; | ||
| 16 | + } | ||
| 17 | + var __v_40 = __f_38(); | ||
| 18 | + __v_40.m(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments