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

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

Issue 976053002: Fix exception for assignment to uninitialised const (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 9 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/messages.js ('k') | src/x64/full-codegen-x64.cc » ('j') | 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/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
11 #include "src/scopeinfo.h" 11 #include "src/scopeinfo.h"
12 #include "src/scopes.h" 12 #include "src/scopes.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 static Object* ThrowRedeclarationError(Isolate* isolate, Handle<String> name) { 17 static Object* ThrowRedeclarationError(Isolate* isolate, Handle<String> name) {
18 HandleScope scope(isolate); 18 HandleScope scope(isolate);
19 Handle<Object> args[1] = {name}; 19 Handle<Object> args[1] = {name};
20 THROW_NEW_ERROR_RETURN_FAILURE( 20 THROW_NEW_ERROR_RETURN_FAILURE(
21 isolate, NewTypeError("var_redeclaration", HandleVector(args, 1))); 21 isolate, NewTypeError("var_redeclaration", HandleVector(args, 1)));
22 } 22 }
23 23
24 24
25 RUNTIME_FUNCTION(Runtime_ThrowConstAssignError) { 25 RUNTIME_FUNCTION(Runtime_ThrowConstAssignError) {
26 HandleScope scope(isolate); 26 HandleScope scope(isolate);
27 THROW_NEW_ERROR_RETURN_FAILURE( 27 THROW_NEW_ERROR_RETURN_FAILURE(
28 isolate, 28 isolate,
29 NewTypeError("harmony_const_assign", HandleVector<Object>(NULL, 0))); 29 NewTypeError("const_assign", HandleVector<Object>(NULL, 0)));
30 } 30 }
31 31
32 32
33 // May throw a RedeclarationError. 33 // May throw a RedeclarationError.
34 static Object* DeclareGlobals(Isolate* isolate, Handle<GlobalObject> global, 34 static Object* DeclareGlobals(Isolate* isolate, Handle<GlobalObject> global,
35 Handle<String> name, Handle<Object> value, 35 Handle<String> name, Handle<Object> value,
36 PropertyAttributes attr, bool is_var, 36 PropertyAttributes attr, bool is_var,
37 bool is_const, bool is_function) { 37 bool is_const, bool is_function) {
38 Handle<ScriptContextTable> script_contexts( 38 Handle<ScriptContextTable> script_contexts(
39 global->native_context()->script_context_table()); 39 global->native_context()->script_context_table());
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 return Smi::FromInt(frame->GetArgumentsLength()); 1114 return Smi::FromInt(frame->GetArgumentsLength());
1115 } 1115 }
1116 1116
1117 1117
1118 RUNTIME_FUNCTION(RuntimeReference_Arguments) { 1118 RUNTIME_FUNCTION(RuntimeReference_Arguments) {
1119 SealHandleScope shs(isolate); 1119 SealHandleScope shs(isolate);
1120 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate); 1120 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate);
1121 } 1121 }
1122 } 1122 }
1123 } // namespace v8::internal 1123 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698