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

Side by Side Diff: src/parser.cc

Issue 264333007: Add OnCompileError handler and v8::CompileError debug event (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 years, 5 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/debug-debugger.js ('k') | test/cctest/test-debug.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/char-predicates-inl.h" 10 #include "src/char-predicates-inl.h"
(...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3881 Handle<FixedArray> elements = factory->NewFixedArray(has_arg ? 1 : 0); 3881 Handle<FixedArray> elements = factory->NewFixedArray(has_arg ? 1 : 0);
3882 if (pending_error_arg_ != NULL) { 3882 if (pending_error_arg_ != NULL) {
3883 Handle<String> arg_string = pending_error_arg_->string(); 3883 Handle<String> arg_string = pending_error_arg_->string();
3884 elements->set(0, *arg_string); 3884 elements->set(0, *arg_string);
3885 } else if (pending_error_char_arg_ != NULL) { 3885 } else if (pending_error_char_arg_ != NULL) {
3886 Handle<String> arg_string = 3886 Handle<String> arg_string =
3887 factory->NewStringFromUtf8(CStrVector(pending_error_char_arg_)) 3887 factory->NewStringFromUtf8(CStrVector(pending_error_char_arg_))
3888 .ToHandleChecked(); 3888 .ToHandleChecked();
3889 elements->set(0, *arg_string); 3889 elements->set(0, *arg_string);
3890 } 3890 }
3891 isolate()->debug()->OnCompileError(script_);
3892
3891 Handle<JSArray> array = factory->NewJSArrayWithElements(elements); 3893 Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
3892 Handle<Object> result = pending_error_is_reference_error_ 3894 Handle<Object> result = pending_error_is_reference_error_
3893 ? factory->NewReferenceError(pending_error_message_, array) 3895 ? factory->NewReferenceError(pending_error_message_, array)
3894 : factory->NewSyntaxError(pending_error_message_, array); 3896 : factory->NewSyntaxError(pending_error_message_, array);
3895 isolate()->Throw(*result, &location); 3897 isolate()->Throw(*result, &location);
3896 } 3898 }
3897 } 3899 }
3898 3900
3899 3901
3900 // ---------------------------------------------------------------------------- 3902 // ----------------------------------------------------------------------------
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
4835 ASSERT(ast_value_factory_->IsInternalized()); 4837 ASSERT(ast_value_factory_->IsInternalized());
4836 // info takes ownership of ast_value_factory_. 4838 // info takes ownership of ast_value_factory_.
4837 if (info()->ast_value_factory() == NULL) { 4839 if (info()->ast_value_factory() == NULL) {
4838 info()->SetAstValueFactory(ast_value_factory_); 4840 info()->SetAstValueFactory(ast_value_factory_);
4839 } 4841 }
4840 ast_value_factory_ = NULL; 4842 ast_value_factory_ = NULL;
4841 return (result != NULL); 4843 return (result != NULL);
4842 } 4844 }
4843 4845
4844 } } // namespace v8::internal 4846 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug-debugger.js ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698