| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 Handle<String> key = factory()->stack_overflow_string(); | 852 Handle<String> key = factory()->stack_overflow_string(); |
| 853 Handle<JSObject> boilerplate = | 853 Handle<JSObject> boilerplate = |
| 854 Handle<JSObject>::cast(Object::GetProperty(js_builtins_object(), key)); | 854 Handle<JSObject>::cast(Object::GetProperty(js_builtins_object(), key)); |
| 855 Handle<JSObject> exception = JSObject::Copy(boilerplate); | 855 Handle<JSObject> exception = JSObject::Copy(boilerplate); |
| 856 DoThrow(*exception, NULL); | 856 DoThrow(*exception, NULL); |
| 857 | 857 |
| 858 // Get stack trace limit. | 858 // Get stack trace limit. |
| 859 Handle<Object> error = | 859 Handle<Object> error = |
| 860 GetProperty(js_builtins_object(), "$Error").ToHandleChecked(); | 860 GetProperty(js_builtins_object(), "$Error").ToHandleChecked(); |
| 861 if (!error->IsJSObject()) return Failure::Exception(); | 861 if (!error->IsJSObject()) return Failure::Exception(); |
| 862 |
| 863 Handle<String> stackTraceLimit = |
| 864 factory()->InternalizeUtf8String("stackTraceLimit"); |
| 865 ASSERT(!stackTraceLimit.is_null()); |
| 862 Handle<Object> stack_trace_limit = | 866 Handle<Object> stack_trace_limit = |
| 863 GetProperty( | 867 JSObject::GetDataProperty(Handle<JSObject>::cast(error), |
| 864 Handle<JSObject>::cast(error), "stackTraceLimit").ToHandleChecked(); | 868 stackTraceLimit); |
| 865 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); | 869 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); |
| 866 double dlimit = stack_trace_limit->Number(); | 870 double dlimit = stack_trace_limit->Number(); |
| 867 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); | 871 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); |
| 868 | 872 |
| 869 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( | 873 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( |
| 870 exception, factory()->undefined_value(), limit); | 874 exception, factory()->undefined_value(), limit); |
| 871 JSObject::SetHiddenProperty(exception, | 875 JSObject::SetHiddenProperty(exception, |
| 872 factory()->hidden_stack_trace_string(), | 876 factory()->hidden_stack_trace_string(), |
| 873 stack_trace); | 877 stack_trace); |
| 874 return Failure::Exception(); | 878 return Failure::Exception(); |
| (...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2287 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); | 2291 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
| 2288 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); | 2292 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
| 2289 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); | 2293 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); |
| 2290 } | 2294 } |
| 2291 } | 2295 } |
| 2292 return Handle<JSObject>::cast(factory()->symbol_registry()); | 2296 return Handle<JSObject>::cast(factory()->symbol_registry()); |
| 2293 } | 2297 } |
| 2294 | 2298 |
| 2295 | 2299 |
| 2296 } } // namespace v8::internal | 2300 } } // namespace v8::internal |
| OLD | NEW |