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

Side by Side Diff: src/runtime/runtime-scopes.cc

Issue 1082013003: Revert of Eagerly declare eval scopes, even for sloppy scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/frames-inl.h" 9 #include "src/frames-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 Handle<Object> holder = 233 Handle<Object> holder =
234 context->Lookup(name, flags, &index, &attributes, &binding_flags); 234 context->Lookup(name, flags, &index, &attributes, &binding_flags);
235 235
236 Handle<JSObject> object; 236 Handle<JSObject> object;
237 Handle<Object> value = 237 Handle<Object> value =
238 is_function ? initial_value 238 is_function ? initial_value
239 : Handle<Object>::cast(isolate->factory()->undefined_value()); 239 : Handle<Object>::cast(isolate->factory()->undefined_value());
240 240
241 // TODO(verwaest): This case should probably not be covered by this function, 241 // TODO(verwaest): This case should probably not be covered by this function,
242 // but by DeclareGlobals instead. 242 // but by DeclareGlobals instead.
243 if (attributes != ABSENT && holder->IsJSGlobalObject()) { 243 if ((attributes != ABSENT && holder->IsJSGlobalObject()) ||
244 (context_arg->has_extension() &&
245 context_arg->extension()->IsJSGlobalObject())) {
244 return DeclareGlobals(isolate, Handle<JSGlobalObject>::cast(holder), name, 246 return DeclareGlobals(isolate, Handle<JSGlobalObject>::cast(holder), name,
245 value, attr, is_var, is_const, is_function); 247 value, attr, is_var, is_const, is_function);
246 } 248 }
247 if (context_arg->has_extension() &&
248 context_arg->extension()->IsJSGlobalObject()) {
249 Handle<JSGlobalObject> global(
250 JSGlobalObject::cast(context_arg->extension()), isolate);
251 return DeclareGlobals(isolate, global, name, value, attr, is_var, is_const,
252 is_function);
253 }
254 249
255 if (attributes != ABSENT) { 250 if (attributes != ABSENT) {
256 // The name was declared before; check for conflicting re-declarations. 251 // The name was declared before; check for conflicting re-declarations.
257 if (is_const || (attributes & READ_ONLY) != 0) { 252 if (is_const || (attributes & READ_ONLY) != 0) {
258 return ThrowRedeclarationError(isolate, name); 253 return ThrowRedeclarationError(isolate, name);
259 } 254 }
260 255
261 // Skip var re-declarations. 256 // Skip var re-declarations.
262 if (is_var) return isolate->heap()->undefined_value(); 257 if (is_var) return isolate->heap()->undefined_value();
263 258
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 return Smi::FromInt(frame->GetArgumentsLength()); 1115 return Smi::FromInt(frame->GetArgumentsLength());
1121 } 1116 }
1122 1117
1123 1118
1124 RUNTIME_FUNCTION(Runtime_Arguments) { 1119 RUNTIME_FUNCTION(Runtime_Arguments) {
1125 SealHandleScope shs(isolate); 1120 SealHandleScope shs(isolate);
1126 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); 1121 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate);
1127 } 1122 }
1128 } 1123 }
1129 } // namespace v8::internal 1124 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698