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

Unified Diff: src/ast/scopes.cc

Issue 1507273002: Make Error.prototype.toString spec compliant; and fix various side-effect-free error printing metho… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/contexts.h » ('j') | src/messages.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 1eda493d6e5d7880e709824e659c4958319a2cca..cf5dd29b66ed448d6c59891996749a08eed92eb2 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1154,7 +1154,13 @@ bool Scope::ResolveVariable(ParseInfo* info, VariableProxy* proxy,
// - Variables must not be allocated to the global scope.
CHECK_NOT_NULL(outer_scope());
// - Variables must be bound locally or unallocated.
- CHECK_EQ(BOUND, binding_kind);
+ if (BOUND != binding_kind) {
+ // The following variable name may be minified. If so, disable
+ // minification in js2c.py for better output.
+ Handle<String> name = proxy->raw_name()->string();
+ V8_Fatal(__FILE__, __LINE__, "Unbound variable: '%s' in native script.",
+ name->ToCString().get());
+ }
VariableLocation location = var->location();
CHECK(location == VariableLocation::LOCAL ||
location == VariableLocation::CONTEXT ||
« no previous file with comments | « src/api.cc ('k') | src/contexts.h » ('j') | src/messages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698