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

Unified Diff: src/scopeinfo.cc

Issue 1181733002: Revert of Replace SetObjectProperty / DefineObjectProperty with less powerful alternatives where relevant. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.cc
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
index f91df650800cb432abdef22d98cc3b29d6b2e1a1..b819b172c4ad1db78926b0d59dc253d9841de94f 100644
--- a/src/scopeinfo.cc
+++ b/src/scopeinfo.cc
@@ -505,12 +505,12 @@
}
-void ScopeInfo::CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info,
+bool ScopeInfo::CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info,
Handle<Context> context,
Handle<JSObject> scope_object) {
Isolate* isolate = scope_info->GetIsolate();
int local_count = scope_info->ContextLocalCount();
- if (local_count == 0) return;
+ if (local_count == 0) return true;
// Fill all context locals to the context extension.
int first_context_var = scope_info->StackLocalCount();
int start = scope_info->ContextLocalNameEntriesIndex();
@@ -520,12 +520,14 @@
Handle<Object> value = Handle<Object>(context->get(context_index), isolate);
// Reflect variables under TDZ as undefined in scope object.
if (value->IsTheHole()) continue;
- // This should always succeed.
- // TODO(verwaest): Use AddDataProperty instead.
- JSObject::SetOwnPropertyIgnoreAttributes(
- scope_object, handle(String::cast(scope_info->get(i + start))), value,
- ::NONE).Check();
- }
+ RETURN_ON_EXCEPTION_VALUE(
+ isolate, Runtime::DefineObjectProperty(
+ scope_object,
+ Handle<String>(String::cast(scope_info->get(i + start))),
+ value, ::NONE),
+ false);
+ }
+ return true;
}
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698