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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 Handle<JSObject>::cast(GetProperty(this, js_builtins_object(), key)); | 1035 Handle<JSObject>::cast(GetProperty(this, js_builtins_object(), key)); |
1036 Handle<JSObject> exception = Copy(boilerplate); | 1036 Handle<JSObject> exception = Copy(boilerplate); |
1037 DoThrow(*exception, NULL); | 1037 DoThrow(*exception, NULL); |
1038 | 1038 |
1039 // Get stack trace limit. | 1039 // Get stack trace limit. |
1040 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); | 1040 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); |
1041 if (!error->IsJSObject()) return Failure::Exception(); | 1041 if (!error->IsJSObject()) return Failure::Exception(); |
1042 Handle<Object> stack_trace_limit = | 1042 Handle<Object> stack_trace_limit = |
1043 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); | 1043 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); |
1044 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); | 1044 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); |
1045 int limit = static_cast<int>(stack_trace_limit->Number()); | 1045 double dlimit = stack_trace_limit->Number(); |
| 1046 int limit = isnan(dlimit) ? 0 : static_cast<int>(dlimit); |
1046 | 1047 |
1047 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( | 1048 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( |
1048 exception, factory()->undefined_value(), limit); | 1049 exception, factory()->undefined_value(), limit); |
1049 JSObject::SetHiddenProperty(exception, | 1050 JSObject::SetHiddenProperty(exception, |
1050 factory()->hidden_stack_trace_string(), | 1051 factory()->hidden_stack_trace_string(), |
1051 stack_trace); | 1052 stack_trace); |
1052 return Failure::Exception(); | 1053 return Failure::Exception(); |
1053 } | 1054 } |
1054 | 1055 |
1055 | 1056 |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2340 | 2341 |
2341 #ifdef DEBUG | 2342 #ifdef DEBUG |
2342 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2343 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2343 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2344 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2344 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2345 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2345 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2346 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2346 #undef ISOLATE_FIELD_OFFSET | 2347 #undef ISOLATE_FIELD_OFFSET |
2347 #endif | 2348 #endif |
2348 | 2349 |
2349 } } // namespace v8::internal | 2350 } } // namespace v8::internal |
OLD | NEW |