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

Side by Side Diff: src/pending-compilation-error-handler.cc

Issue 1295093002: Do not use js builtins object when constructing an error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix failures. Created 5 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 unified diff | Download patch
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/error-constructors.js » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/pending-compilation-error-handler.h" 5 #include "src/pending-compilation-error-handler.h"
6 6
7 #include "src/debug/debug.h" 7 #include "src/debug/debug.h"
8 #include "src/handles.h" 8 #include "src/handles.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 13 matching lines...) Expand all
24 argument = 24 argument =
25 factory->NewStringFromUtf8(CStrVector(char_arg_)).ToHandleChecked(); 25 factory->NewStringFromUtf8(CStrVector(char_arg_)).ToHandleChecked();
26 } else if (!handle_arg_.is_null()) { 26 } else if (!handle_arg_.is_null()) {
27 argument = handle_arg_; 27 argument = handle_arg_;
28 } 28 }
29 isolate->debug()->OnCompileError(script); 29 isolate->debug()->OnCompileError(script);
30 30
31 Handle<Object> error; 31 Handle<Object> error;
32 switch (error_type_) { 32 switch (error_type_) {
33 case kReferenceError: 33 case kReferenceError:
34 error = factory->NewError("MakeReferenceError", message_, argument); 34 error = factory->NewReferenceError(message_, argument);
35 break; 35 break;
36 case kSyntaxError: 36 case kSyntaxError:
37 error = factory->NewError("MakeSyntaxError", message_, argument); 37 error = factory->NewSyntaxError(message_, argument);
38 break; 38 break;
39 default: 39 default:
40 UNREACHABLE(); 40 UNREACHABLE();
41 break; 41 break;
42 } 42 }
43 43
44 if (!error->IsJSObject()) { 44 if (!error->IsJSObject()) {
45 isolate->Throw(*error, &location); 45 isolate->Throw(*error, &location);
46 return; 46 return;
47 } 47 }
(...skipping 10 matching lines...) Expand all
58 handle(Smi::FromInt(location.end_pos()), isolate), 58 handle(Smi::FromInt(location.end_pos()), isolate),
59 SLOPPY).Check(); 59 SLOPPY).Check();
60 60
61 Handle<Name> key_script = factory->error_script_symbol(); 61 Handle<Name> key_script = factory->error_script_symbol();
62 JSObject::SetProperty(jserror, key_script, script, SLOPPY).Check(); 62 JSObject::SetProperty(jserror, key_script, script, SLOPPY).Check();
63 63
64 isolate->Throw(*error, &location); 64 isolate->Throw(*error, &location);
65 } 65 }
66 } // namespace internal 66 } // namespace internal
67 } // namespace v8 67 } // namespace v8
OLDNEW
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/error-constructors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698