Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "bindings/core/v8/V8PromiseRejectionEvent.h" | |
| 7 | |
|
haraken
2015/06/19 11:38:02
Add more includes. V8Bindings.h, ScriptPromise.h,
jochen (gone - plz use gerrit)
2015/06/19 12:06:21
done
| |
| 8 namespace blink { | |
| 9 | |
| 10 void V8PromiseRejectionEvent::promiseAttributeGetterCustom(const v8::PropertyCal lbackInfo<v8::Value>& info) | |
| 11 { | |
| 12 v8::Isolate* isolate = info.GetIsolate(); | |
| 13 PromiseRejectionEvent* event = V8PromiseRejectionEvent::toImpl(info.Holder() ); | |
| 14 ScriptPromise promise = event->promise(); | |
| 15 if (promise.isEmpty() || promise.scriptValue().scriptState()->world().worldI d() != ScriptState::current(isolate)->world().worldId()) { | |
|
haraken
2015/06/19 11:38:03
Let's add some comment.
// Return null when the p
jochen (gone - plz use gerrit)
2015/06/19 12:06:21
done
| |
| 16 v8SetReturnValue(info, v8::Null(isolate)); | |
| 17 return; | |
| 18 } | |
| 19 | |
| 20 v8SetReturnValue(info, promise.v8Value()); | |
| 21 } | |
| 22 | |
| 23 void V8PromiseRejectionEvent::reasonAttributeGetterCustom(const v8::PropertyCall backInfo<v8::Value>& info) | |
| 24 { | |
| 25 v8::Isolate* isolate = info.GetIsolate(); | |
| 26 PromiseRejectionEvent* event = V8PromiseRejectionEvent::toImpl(info.Holder() ); | |
| 27 ScriptValue reason = event->reason(); | |
| 28 if (reason.isEmpty() || reason.scriptState()->world().worldId() != ScriptSta te::current(isolate)->world().worldId()) { | |
|
haraken
2015/06/19 11:38:02
Ditto.
jochen (gone - plz use gerrit)
2015/06/19 12:06:21
done
| |
| 29 v8SetReturnValue(info, v8::Null(isolate)); | |
| 30 return; | |
| 31 } | |
| 32 | |
| 33 v8SetReturnValue(info, reason.v8Value()); | |
| 34 } | |
| 35 | |
| 36 } // namespace blink | |
| OLD | NEW |