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

Unified Diff: src/contexts.cc

Issue 7671042: Temporal dead zone behaviour for let bindings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Bailout in hydrogen and X64 and ARM code. Created 9 years, 4 months 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
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index c0e724253f2767ed2a6bbbee436db3c99cd9f62a..4f93abdff1d0c50a9058c2f35b934719cb4f8ef2 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -87,13 +87,15 @@ void Context::set_global_proxy(JSObject* object) {
Handle<Object> Context::Lookup(Handle<String> name,
ContextLookupFlags flags,
int* index_,
- PropertyAttributes* attributes) {
+ PropertyAttributes* attributes,
+ BindingFlags* binding_flags) {
Isolate* isolate = GetIsolate();
Handle<Context> context(this, isolate);
bool follow_context_chain = (flags & FOLLOW_CONTEXT_CHAIN) != 0;
*index_ = -1;
*attributes = ABSENT;
+ *binding_flags = MISSING_BINDING;
if (FLAG_trace_contexts) {
PrintF("Context::Lookup(");
@@ -118,6 +120,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
}
*index_ = Context::THROWN_OBJECT_INDEX;
*attributes = NONE;
+ *binding_flags = MUTABLE_IS_INITIALIZED;
return context;
}
} else {
@@ -180,11 +183,16 @@ Handle<Object> Context::Lookup(Handle<String> name,
switch (mode) {
case Variable::INTERNAL: // Fall through.
case Variable::VAR:
+ *attributes = NONE;
+ *binding_flags = MUTABLE_IS_INITIALIZED;
+ break;
case Variable::LET:
*attributes = NONE;
+ *binding_flags = MUTABLE_CHECK_INITIALIZED;
break;
case Variable::CONST:
*attributes = READ_ONLY;
+ *binding_flags = IMMUTABLE_CHECK_INITIALIZED;
break;
case Variable::DYNAMIC:
case Variable::DYNAMIC_GLOBAL:
@@ -207,6 +215,7 @@ Handle<Object> Context::Lookup(Handle<String> name,
}
*index_ = index;
*attributes = READ_ONLY;
+ *binding_flags = IMMUTABLE_IS_INITIALIZED;
return context;
}
}
« no previous file with comments | « src/contexts.h ('k') | src/heap.cc » ('j') | test/mjsunit/harmony/block-let-crankshaft.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698