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 | |
644 %InstallToContext([ | 640 %InstallToContext([ |
645 "error_format_stack_trace", FormatStackTrace, | 641 "error_format_stack_trace", FormatStackTrace, |
646 "get_stack_trace_line_fun", GetStackTraceLine, | 642 "get_stack_trace_line_fun", GetStackTraceLine, |
647 "make_error_function", MakeGenericError, | 643 "make_error_function", MakeGenericError, |
648 "make_range_error", MakeRangeError, | 644 "make_range_error", MakeRangeError, |
649 "make_type_error", MakeTypeError, | 645 "make_type_error", MakeTypeError, |
650 "message_get_column_number", GetColumnNumber, | 646 "message_get_column_number", GetColumnNumber, |
651 "message_get_line_number", GetLineNumber, | 647 "message_get_line_number", GetLineNumber, |
652 "message_get_source_line", GetSourceLine, | 648 "message_get_source_line", GetSourceLine, |
653 "no_side_effects_to_string_fun", NoSideEffectsToString, | 649 "no_side_effects_to_string_fun", NoSideEffectsToString, |
654 "stack_overflow_boilerplate", StackOverflowBoilerplate, | |
655 ]); | 650 ]); |
656 | 651 |
657 utils.Export(function(to) { | 652 utils.Export(function(to) { |
658 to.ErrorToString = ErrorToString; | 653 to.ErrorToString = ErrorToString; |
659 to.MakeError = MakeError; | 654 to.MakeError = MakeError; |
660 to.MakeRangeError = MakeRangeError; | 655 to.MakeRangeError = MakeRangeError; |
661 to.MakeSyntaxError = MakeSyntaxError; | 656 to.MakeSyntaxError = MakeSyntaxError; |
662 to.MakeTypeError = MakeTypeError; | 657 to.MakeTypeError = MakeTypeError; |
663 to.MakeURIError = MakeURIError; | 658 to.MakeURIError = MakeURIError; |
664 }); | 659 }); |
665 | 660 |
666 }); | 661 }); |
OLD | NEW |