| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 v8::Handle<v8::Value> exception = toV8(domException, creationContext, isolat
e); | 66 v8::Handle<v8::Value> exception = toV8(domException, creationContext, isolat
e); |
| 67 | 67 |
| 68 if (exception.IsEmpty()) | 68 if (exception.IsEmpty()) |
| 69 return v8Undefined(); | 69 return v8Undefined(); |
| 70 | 70 |
| 71 // Attach an Error object to the DOMException. This is then lazily used to g
et the stack value. | 71 // Attach an Error object to the DOMException. This is then lazily used to g
et the stack value. |
| 72 v8::Handle<v8::Value> error = v8::Exception::Error(v8String(isolate, domExce
ption->message())); | 72 v8::Handle<v8::Value> error = v8::Exception::Error(v8String(isolate, domExce
ption->message())); |
| 73 ASSERT(!error.IsEmpty()); | 73 ASSERT(!error.IsEmpty()); |
| 74 ASSERT(exception->IsObject()); | 74 ASSERT(exception->IsObject()); |
| 75 exception->ToObject()->SetAccessor(v8AtomicString(isolate, "stack"), domExce
ptionStackGetter, domExceptionStackSetter, error); | 75 exception->ToObject()->SetAccessor(v8AtomicString(isolate, "stack"), domExce
ptionStackGetter, domExceptionStackSetter, error); |
| 76 V8HiddenValue::setHiddenValue(isolate, exception->ToObject(), V8HiddenValue:
:error(isolate), error); |
| 76 | 77 |
| 77 return exception; | 78 return exception; |
| 78 } | 79 } |
| 79 | 80 |
| 80 v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String&
sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>
& creationContext, v8::Isolate* isolate) | 81 v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String&
sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>
& creationContext, v8::Isolate* isolate) |
| 81 { | 82 { |
| 82 ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty()); | 83 ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty()); |
| 83 v8::Handle<v8::Value> exception = createDOMException(ec, sanitizedMessage, u
nsanitizedMessage, creationContext, isolate); | 84 v8::Handle<v8::Value> exception = createDOMException(ec, sanitizedMessage, u
nsanitizedMessage, creationContext, isolate); |
| 84 if (exception.IsEmpty()) | 85 if (exception.IsEmpty()) |
| 85 return v8Undefined(); | 86 return v8Undefined(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 144 } |
| 144 | 145 |
| 145 v8::Handle<v8::Value> V8ThrowException::throwException(v8::Handle<v8::Value> exc
eption, v8::Isolate* isolate) | 146 v8::Handle<v8::Value> V8ThrowException::throwException(v8::Handle<v8::Value> exc
eption, v8::Isolate* isolate) |
| 146 { | 147 { |
| 147 if (!v8::V8::IsExecutionTerminating()) | 148 if (!v8::V8::IsExecutionTerminating()) |
| 148 isolate->ThrowException(exception); | 149 isolate->ThrowException(exception); |
| 149 return v8::Undefined(isolate); | 150 return v8::Undefined(isolate); |
| 150 } | 151 } |
| 151 | 152 |
| 152 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |