Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp

Issue 2595543003: Rename toV8(...) function in Blink to ToV8(...). (Closed)
Patch Set: Rebasing... Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698