| Index: src/scopeinfo.cc
|
| diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
|
| index c0b2c4c8e6cf4799ccf7a5257cea87ba989f1c31..67ebebc211bfa9843f9408bd2db3ad8961a54d9c 100644
|
| --- a/src/scopeinfo.cc
|
| +++ b/src/scopeinfo.cc
|
| @@ -362,6 +362,31 @@ int ScopeInfo::FunctionContextSlotIndex(String* name, VariableMode* mode) {
|
| }
|
|
|
|
|
| +bool ScopeInfo::CopyContextLocalsToScopeObject(
|
| + Isolate* isolate,
|
| + Handle<Context> context,
|
| + Handle<JSObject> scope_object) {
|
| + int local_count = ContextLocalCount();
|
| + if (local_count == 0) return true;
|
| + // Fill all context locals to the context extension.
|
| + int start = ContextLocalNameEntriesIndex();
|
| + int end = start + local_count;
|
| + for (int i = start; i < end; ++i) {
|
| + int context_index = Context::MIN_CONTEXT_SLOTS + i - start;
|
| + RETURN_IF_EMPTY_HANDLE_VALUE(
|
| + isolate,
|
| + SetProperty(isolate,
|
| + scope_object,
|
| + Handle<String>(String::cast(get(i))),
|
| + Handle<Object>(context->get(context_index), isolate),
|
| + ::NONE,
|
| + kNonStrictMode),
|
| + false);
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +
|
| int ScopeInfo::ParameterEntriesIndex() {
|
| ASSERT(length() > 0);
|
| return kVariablePartIndex;
|
|
|