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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 // At this point we cannot create an Error object using its javascript | 849 // At this point we cannot create an Error object using its javascript |
850 // constructor. Instead, we copy the pre-constructed boilerplate and | 850 // constructor. Instead, we copy the pre-constructed boilerplate and |
851 // attach the stack trace as a hidden property. | 851 // attach the stack trace as a hidden property. |
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 = GetProperty(js_builtins_object(), "$Error"); | 859 Handle<Object> error = |
| 860 GetProperty(js_builtins_object(), "$Error").ToHandleChecked(); |
860 if (!error->IsJSObject()) return Failure::Exception(); | 861 if (!error->IsJSObject()) return Failure::Exception(); |
861 Handle<Object> stack_trace_limit = | 862 Handle<Object> stack_trace_limit = |
862 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); | 863 GetProperty( |
| 864 Handle<JSObject>::cast(error), "stackTraceLimit").ToHandleChecked(); |
863 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); | 865 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); |
864 double dlimit = stack_trace_limit->Number(); | 866 double dlimit = stack_trace_limit->Number(); |
865 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); | 867 int limit = std::isnan(dlimit) ? 0 : static_cast<int>(dlimit); |
866 | 868 |
867 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( | 869 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( |
868 exception, factory()->undefined_value(), limit); | 870 exception, factory()->undefined_value(), limit); |
869 JSObject::SetHiddenProperty(exception, | 871 JSObject::SetHiddenProperty(exception, |
870 factory()->hidden_stack_trace_string(), | 872 factory()->hidden_stack_trace_string(), |
871 stack_trace); | 873 stack_trace); |
872 return Failure::Exception(); | 874 return Failure::Exception(); |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2286 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); | 2288 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
2287 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); | 2289 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
2288 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); | 2290 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); |
2289 } | 2291 } |
2290 } | 2292 } |
2291 return Handle<JSObject>::cast(factory()->symbol_registry()); | 2293 return Handle<JSObject>::cast(factory()->symbol_registry()); |
2292 } | 2294 } |
2293 | 2295 |
2294 | 2296 |
2295 } } // namespace v8::internal | 2297 } } // namespace v8::internal |
OLD | NEW |