| 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 14 matching lines...) Expand all Loading... |
| 25 utils.ImportNow("call_site_strict_symbol"); | 25 utils.ImportNow("call_site_strict_symbol"); |
| 26 var Float32x4ToString; | 26 var Float32x4ToString; |
| 27 var formattedStackTraceSymbol = | 27 var formattedStackTraceSymbol = |
| 28 utils.ImportNow("formatted_stack_trace_symbol"); | 28 utils.ImportNow("formatted_stack_trace_symbol"); |
| 29 var GlobalObject = global.Object; | 29 var GlobalObject = global.Object; |
| 30 var Int16x8ToString; | 30 var Int16x8ToString; |
| 31 var Int32x4ToString; | 31 var Int32x4ToString; |
| 32 var Int8x16ToString; | 32 var Int8x16ToString; |
| 33 var InternalArray = utils.InternalArray; | 33 var InternalArray = utils.InternalArray; |
| 34 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); | 34 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); |
| 35 var ObjectDefineProperty; | |
| 36 var ObjectHasOwnProperty; | 35 var ObjectHasOwnProperty; |
| 37 var ObjectToString = utils.ImportNow("object_to_string"); | 36 var ObjectToString = utils.ImportNow("object_to_string"); |
| 38 var Script = utils.ImportNow("Script"); | 37 var Script = utils.ImportNow("Script"); |
| 39 var stackTraceSymbol = utils.ImportNow("stack_trace_symbol"); | 38 var stackTraceSymbol = utils.ImportNow("stack_trace_symbol"); |
| 40 var StringIndexOf; | 39 var StringIndexOf; |
| 41 var StringSubstring; | 40 var StringSubstring; |
| 42 var SymbolToString; | 41 var SymbolToString; |
| 43 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 42 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
| 44 var Uint16x8ToString; | 43 var Uint16x8ToString; |
| 45 var Uint32x4ToString; | 44 var Uint32x4ToString; |
| 46 var Uint8x16ToString; | 45 var Uint8x16ToString; |
| 47 | 46 |
| 48 utils.Import(function(from) { | 47 utils.Import(function(from) { |
| 49 ArrayJoin = from.ArrayJoin; | 48 ArrayJoin = from.ArrayJoin; |
| 50 Bool16x8ToString = from.Bool16x8ToString; | 49 Bool16x8ToString = from.Bool16x8ToString; |
| 51 Bool32x4ToString = from.Bool32x4ToString; | 50 Bool32x4ToString = from.Bool32x4ToString; |
| 52 Bool8x16ToString = from.Bool8x16ToString; | 51 Bool8x16ToString = from.Bool8x16ToString; |
| 53 Float32x4ToString = from.Float32x4ToString; | 52 Float32x4ToString = from.Float32x4ToString; |
| 54 Int16x8ToString = from.Int16x8ToString; | 53 Int16x8ToString = from.Int16x8ToString; |
| 55 Int32x4ToString = from.Int32x4ToString; | 54 Int32x4ToString = from.Int32x4ToString; |
| 56 Int8x16ToString = from.Int8x16ToString; | 55 Int8x16ToString = from.Int8x16ToString; |
| 57 ObjectDefineProperty = from.ObjectDefineProperty; | |
| 58 ObjectHasOwnProperty = from.ObjectHasOwnProperty; | 56 ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
| 59 StringIndexOf = from.StringIndexOf; | 57 StringIndexOf = from.StringIndexOf; |
| 60 StringSubstring = from.StringSubstring; | 58 StringSubstring = from.StringSubstring; |
| 61 SymbolToString = from.SymbolToString; | 59 SymbolToString = from.SymbolToString; |
| 62 Uint16x8ToString = from.Uint16x8ToString; | 60 Uint16x8ToString = from.Uint16x8ToString; |
| 63 Uint32x4ToString = from.Uint32x4ToString; | 61 Uint32x4ToString = from.Uint32x4ToString; |
| 64 Uint8x16ToString = from.Uint8x16ToString; | 62 Uint8x16ToString = from.Uint8x16ToString; |
| 65 }); | 63 }); |
| 66 | 64 |
| 67 // ------------------------------------------------------------------- | 65 // ------------------------------------------------------------------- |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 985 |
| 988 // Boilerplate for exceptions for stack overflows. Used from | 986 // Boilerplate for exceptions for stack overflows. Used from |
| 989 // Isolate::StackOverflow(). | 987 // Isolate::StackOverflow(). |
| 990 var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); | 988 var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
| 991 utils.InstallGetterSetter(StackOverflowBoilerplate, 'stack', | 989 utils.InstallGetterSetter(StackOverflowBoilerplate, 'stack', |
| 992 StackTraceGetter, StackTraceSetter) | 990 StackTraceGetter, StackTraceSetter) |
| 993 | 991 |
| 994 // Define actual captureStackTrace function after everything has been set up. | 992 // Define actual captureStackTrace function after everything has been set up. |
| 995 captureStackTrace = function captureStackTrace(obj, cons_opt) { | 993 captureStackTrace = function captureStackTrace(obj, cons_opt) { |
| 996 // Define accessors first, as this may fail and throw. | 994 // Define accessors first, as this may fail and throw. |
| 997 ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, | 995 %object_define_property(obj, 'stack', { get: StackTraceGetter, |
| 998 set: StackTraceSetter, | 996 set: StackTraceSetter, |
| 999 configurable: true }); | 997 configurable: true }); |
| 1000 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); | 998 %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); |
| 1001 }; | 999 }; |
| 1002 | 1000 |
| 1003 GlobalError.captureStackTrace = captureStackTrace; | 1001 GlobalError.captureStackTrace = captureStackTrace; |
| 1004 | 1002 |
| 1005 %InstallToContext([ | 1003 %InstallToContext([ |
| 1006 "get_stack_trace_line_fun", GetStackTraceLine, | 1004 "get_stack_trace_line_fun", GetStackTraceLine, |
| 1007 "make_error_function", MakeGenericError, | 1005 "make_error_function", MakeGenericError, |
| 1008 "make_range_error", MakeRangeError, | 1006 "make_range_error", MakeRangeError, |
| 1009 "make_type_error", MakeTypeError, | 1007 "make_type_error", MakeTypeError, |
| 1010 "message_get_column_number", GetColumnNumber, | 1008 "message_get_column_number", GetColumnNumber, |
| 1011 "message_get_line_number", GetLineNumber, | 1009 "message_get_line_number", GetLineNumber, |
| 1012 "message_get_source_line", GetSourceLine, | 1010 "message_get_source_line", GetSourceLine, |
| 1013 "no_side_effects_to_string_fun", NoSideEffectsToString, | 1011 "no_side_effects_to_string_fun", NoSideEffectsToString, |
| 1014 "stack_overflow_boilerplate", StackOverflowBoilerplate, | 1012 "stack_overflow_boilerplate", StackOverflowBoilerplate, |
| 1015 ]); | 1013 ]); |
| 1016 | 1014 |
| 1017 utils.Export(function(to) { | 1015 utils.Export(function(to) { |
| 1018 to.ErrorToString = ErrorToString; | 1016 to.ErrorToString = ErrorToString; |
| 1019 to.MakeError = MakeError; | 1017 to.MakeError = MakeError; |
| 1020 to.MakeRangeError = MakeRangeError; | 1018 to.MakeRangeError = MakeRangeError; |
| 1021 to.MakeSyntaxError = MakeSyntaxError; | 1019 to.MakeSyntaxError = MakeSyntaxError; |
| 1022 to.MakeTypeError = MakeTypeError; | 1020 to.MakeTypeError = MakeTypeError; |
| 1023 to.MakeURIError = MakeURIError; | 1021 to.MakeURIError = MakeURIError; |
| 1024 }); | 1022 }); |
| 1025 | 1023 |
| 1026 }); | 1024 }); |
| OLD | NEW |