OLD | NEW |
---|---|
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 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3847 !pending_error_arg_.is_null() || pending_error_char_arg_ != NULL; | 3847 !pending_error_arg_.is_null() || pending_error_char_arg_ != NULL; |
3848 Handle<FixedArray> elements = factory->NewFixedArray(has_arg ? 1 : 0); | 3848 Handle<FixedArray> elements = factory->NewFixedArray(has_arg ? 1 : 0); |
3849 if (!pending_error_arg_.is_null()) { | 3849 if (!pending_error_arg_.is_null()) { |
3850 elements->set(0, *(pending_error_arg_.ToHandleChecked())); | 3850 elements->set(0, *(pending_error_arg_.ToHandleChecked())); |
3851 } else if (pending_error_char_arg_ != NULL) { | 3851 } else if (pending_error_char_arg_ != NULL) { |
3852 Handle<String> arg_string = | 3852 Handle<String> arg_string = |
3853 factory->NewStringFromUtf8(CStrVector(pending_error_char_arg_)) | 3853 factory->NewStringFromUtf8(CStrVector(pending_error_char_arg_)) |
3854 .ToHandleChecked(); | 3854 .ToHandleChecked(); |
3855 elements->set(0, *arg_string); | 3855 elements->set(0, *arg_string); |
3856 } | 3856 } |
3857 isolate()->debug()->OnCompileError(script_); | |
3858 | |
3857 Handle<JSArray> array = factory->NewJSArrayWithElements(elements); | 3859 Handle<JSArray> array = factory->NewJSArrayWithElements(elements); |
3858 Handle<Object> result = pending_error_is_reference_error_ | 3860 Handle<Object> result = pending_error_is_reference_error_ |
3859 ? factory->NewReferenceError(pending_error_message_, array) | 3861 ? factory->NewReferenceError(pending_error_message_, array) |
3860 : factory->NewSyntaxError(pending_error_message_, array); | 3862 : factory->NewSyntaxError(pending_error_message_, array); |
3861 isolate()->Throw(*result, &location); | 3863 isolate()->Throw(*result, &location); |
Yang
2014/06/11 14:33:37
Won't Debug::OnException trigger as well? The call
| |
3862 } | 3864 } |
3863 } | 3865 } |
3864 | 3866 |
3865 | 3867 |
3866 // ---------------------------------------------------------------------------- | 3868 // ---------------------------------------------------------------------------- |
3867 // Regular expressions | 3869 // Regular expressions |
3868 | 3870 |
3869 | 3871 |
3870 RegExpParser::RegExpParser(FlatStringReader* in, | 3872 RegExpParser::RegExpParser(FlatStringReader* in, |
3871 Handle<String>* error, | 3873 Handle<String>* error, |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4783 ASSERT(info()->isolate()->has_pending_exception()); | 4785 ASSERT(info()->isolate()->has_pending_exception()); |
4784 } else { | 4786 } else { |
4785 result = ParseProgram(); | 4787 result = ParseProgram(); |
4786 } | 4788 } |
4787 } | 4789 } |
4788 info()->SetFunction(result); | 4790 info()->SetFunction(result); |
4789 return (result != NULL); | 4791 return (result != NULL); |
4790 } | 4792 } |
4791 | 4793 |
4792 } } // namespace v8::internal | 4794 } } // namespace v8::internal |
OLD | NEW |