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 // ------------------------------------------------------------------- | 5 // ------------------------------------------------------------------- |
6 | 6 |
7 (function(global, utils) { | 7 (function(global, utils) { |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 630 } |
631 | 631 |
632 function MakeTypeError(type, arg0, arg1, arg2) { | 632 function MakeTypeError(type, arg0, arg1, arg2) { |
633 return MakeGenericError(GlobalTypeError, type, arg0, arg1, arg2); | 633 return MakeGenericError(GlobalTypeError, type, arg0, arg1, arg2); |
634 } | 634 } |
635 | 635 |
636 function MakeURIError() { | 636 function MakeURIError() { |
637 return MakeGenericError(GlobalURIError, kURIMalformed); | 637 return MakeGenericError(GlobalURIError, kURIMalformed); |
638 } | 638 } |
639 | 639 |
| 640 // Boilerplate for exceptions for stack overflows. Used from |
| 641 // Isolate::StackOverflow(). |
| 642 var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
| 643 |
640 %InstallToContext([ | 644 %InstallToContext([ |
641 "error_format_stack_trace", FormatStackTrace, | 645 "error_format_stack_trace", FormatStackTrace, |
642 "get_stack_trace_line_fun", GetStackTraceLine, | 646 "get_stack_trace_line_fun", GetStackTraceLine, |
643 "make_error_function", MakeGenericError, | 647 "make_error_function", MakeGenericError, |
644 "make_range_error", MakeRangeError, | 648 "make_range_error", MakeRangeError, |
645 "make_type_error", MakeTypeError, | 649 "make_type_error", MakeTypeError, |
646 "message_get_column_number", GetColumnNumber, | 650 "message_get_column_number", GetColumnNumber, |
647 "message_get_line_number", GetLineNumber, | 651 "message_get_line_number", GetLineNumber, |
648 "message_get_source_line", GetSourceLine, | 652 "message_get_source_line", GetSourceLine, |
649 "no_side_effects_to_string_fun", NoSideEffectsToString, | 653 "no_side_effects_to_string_fun", NoSideEffectsToString, |
| 654 "stack_overflow_boilerplate", StackOverflowBoilerplate, |
650 ]); | 655 ]); |
651 | 656 |
652 utils.Export(function(to) { | 657 utils.Export(function(to) { |
653 to.ErrorToString = ErrorToString; | 658 to.ErrorToString = ErrorToString; |
654 to.MakeError = MakeError; | 659 to.MakeError = MakeError; |
655 to.MakeRangeError = MakeRangeError; | 660 to.MakeRangeError = MakeRangeError; |
656 to.MakeSyntaxError = MakeSyntaxError; | 661 to.MakeSyntaxError = MakeSyntaxError; |
657 to.MakeTypeError = MakeTypeError; | 662 to.MakeTypeError = MakeTypeError; |
658 to.MakeURIError = MakeURIError; | 663 to.MakeURIError = MakeURIError; |
659 }); | 664 }); |
660 | 665 |
661 }); | 666 }); |
OLD | NEW |