OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "bindings/core/v8/V8Binding.h" | 29 #include "bindings/core/v8/V8Binding.h" |
30 #include "bindings/core/v8/V8DOMException.h" | 30 #include "bindings/core/v8/V8DOMException.h" |
31 #include "core/dom/DOMException.h" | 31 #include "core/dom/DOMException.h" |
32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 static void domExceptionStackGetter(v8::Local<v8::Name> name, const v8::Property
CallbackInfo<v8::Value>& info) | 36 static void domExceptionStackGetter(v8::Local<v8::Name> name, const v8::Property
CallbackInfo<v8::Value>& info) |
37 { | 37 { |
38 ASSERT(info.Data()->IsObject()); | 38 ASSERT(info.Data()->IsObject()); |
39 v8SetReturnValue(info, info.Data()->ToObject(info.GetIsolate())->Get(v8Atomi
cString(info.GetIsolate(), "stack"))); | 39 v8::Isolate* isolate = info.GetIsolate(); |
| 40 v8::Local<v8::Value> value; |
| 41 if (info.Data().As<v8::Object>()->Get(isolate->GetCurrentContext(), v8Atomic
String(isolate, "stack")).ToLocal(&value)) |
| 42 v8SetReturnValue(info, value); |
40 } | 43 } |
41 | 44 |
42 static void domExceptionStackSetter(v8::Local<v8::Name> name, v8::Local<v8::Valu
e> value, const v8::PropertyCallbackInfo<void>& info) | 45 static void domExceptionStackSetter(v8::Local<v8::Name> name, v8::Local<v8::Valu
e> value, const v8::PropertyCallbackInfo<void>& info) |
43 { | 46 { |
44 ASSERT(info.Data()->IsObject()); | 47 ASSERT(info.Data()->IsObject()); |
45 info.Data()->ToObject(info.GetIsolate())->Set(v8AtomicString(info.GetIsolate
(), "stack"), value); | 48 info.Data()->ToObject(info.GetIsolate())->Set(v8AtomicString(info.GetIsolate
(), "stack"), value); |
46 } | 49 } |
47 | 50 |
48 v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate,
int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const
v8::Handle<v8::Object>& creationContext) | 51 v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate,
int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const
v8::Handle<v8::Object>& creationContext) |
49 { | 52 { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 161 } |
159 | 162 |
160 v8::Handle<v8::Value> V8ThrowException::throwException(v8::Handle<v8::Value> exc
eption, v8::Isolate* isolate) | 163 v8::Handle<v8::Value> V8ThrowException::throwException(v8::Handle<v8::Value> exc
eption, v8::Isolate* isolate) |
161 { | 164 { |
162 if (!v8::V8::IsExecutionTerminating()) | 165 if (!v8::V8::IsExecutionTerminating()) |
163 isolate->ThrowException(exception); | 166 isolate->ThrowException(exception); |
164 return v8::Undefined(isolate); | 167 return v8::Undefined(isolate); |
165 } | 168 } |
166 | 169 |
167 } // namespace blink | 170 } // namespace blink |
OLD | NEW |