| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return createRangeError(isolate, sanitizedMessage); | 77 return createRangeError(isolate, sanitizedMessage); |
| 78 case V8SyntaxError: | 78 case V8SyntaxError: |
| 79 return createSyntaxError(isolate, sanitizedMessage); | 79 return createSyntaxError(isolate, sanitizedMessage); |
| 80 case V8ReferenceError: | 80 case V8ReferenceError: |
| 81 return createReferenceError(isolate, sanitizedMessage); | 81 return createReferenceError(isolate, sanitizedMessage); |
| 82 } | 82 } |
| 83 | 83 |
| 84 DOMException* domException = | 84 DOMException* domException = |
| 85 DOMException::create(exceptionCode, sanitizedMessage, unsanitizedMessage); | 85 DOMException::create(exceptionCode, sanitizedMessage, unsanitizedMessage); |
| 86 v8::Local<v8::Object> exceptionObj = | 86 v8::Local<v8::Object> exceptionObj = |
| 87 toV8(domException, isolate->GetCurrentContext()->Global(), isolate) | 87 ToV8(domException, isolate->GetCurrentContext()->Global(), isolate) |
| 88 .As<v8::Object>(); | 88 .As<v8::Object>(); |
| 89 // Attach an Error object to the DOMException. This is then lazily used to | 89 // Attach an Error object to the DOMException. This is then lazily used to |
| 90 // get the stack value. | 90 // get the stack value. |
| 91 v8::Local<v8::Value> error = | 91 v8::Local<v8::Value> error = |
| 92 v8::Exception::Error(v8String(isolate, domException->message())); | 92 v8::Exception::Error(v8String(isolate, domException->message())); |
| 93 exceptionObj | 93 exceptionObj |
| 94 ->SetAccessor(isolate->GetCurrentContext(), | 94 ->SetAccessor(isolate->GetCurrentContext(), |
| 95 v8AtomicString(isolate, "stack"), domExceptionStackGetter, | 95 v8AtomicString(isolate, "stack"), domExceptionStackGetter, |
| 96 domExceptionStackSetter, error) | 96 domExceptionStackSetter, error) |
| 97 .ToChecked(); | 97 .ToChecked(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 119 DEFINE_CREATE_AND_THROW_ERROR_FUNC(RangeError, RangeError, "Range error") | 119 DEFINE_CREATE_AND_THROW_ERROR_FUNC(RangeError, RangeError, "Range error") |
| 120 DEFINE_CREATE_AND_THROW_ERROR_FUNC(ReferenceError, | 120 DEFINE_CREATE_AND_THROW_ERROR_FUNC(ReferenceError, |
| 121 ReferenceError, | 121 ReferenceError, |
| 122 "Reference error") | 122 "Reference error") |
| 123 DEFINE_CREATE_AND_THROW_ERROR_FUNC(SyntaxError, SyntaxError, "Syntax error") | 123 DEFINE_CREATE_AND_THROW_ERROR_FUNC(SyntaxError, SyntaxError, "Syntax error") |
| 124 DEFINE_CREATE_AND_THROW_ERROR_FUNC(TypeError, TypeError, "Type error") | 124 DEFINE_CREATE_AND_THROW_ERROR_FUNC(TypeError, TypeError, "Type error") |
| 125 | 125 |
| 126 #undef DEFINE_CREATE_AND_THROW_ERROR_FUNC | 126 #undef DEFINE_CREATE_AND_THROW_ERROR_FUNC |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |