| Index: Source/bindings/core/v8/custom/V8PromiseRejectionEventCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8PromiseRejectionEventCustom.cpp b/Source/bindings/core/v8/custom/V8PromiseRejectionEventCustom.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e38f04cd07c2f28be04c6d9dc4b0f92057e3fdfb
|
| --- /dev/null
|
| +++ b/Source/bindings/core/v8/custom/V8PromiseRejectionEventCustom.cpp
|
| @@ -0,0 +1,28 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "config.h"
|
| +#include "bindings/core/v8/V8PromiseRejectionEvent.h"
|
| +
|
| +#include "bindings/core/v8/ScriptPromise.h"
|
| +#include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/core/v8/ScriptValue.h"
|
| +#include "bindings/core/v8/V8Binding.h"
|
| +
|
| +namespace blink {
|
| +
|
| +void V8PromiseRejectionEvent::promiseAttributeGetterCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| +{
|
| + v8::Isolate* isolate = info.GetIsolate();
|
| + PromiseRejectionEvent* event = V8PromiseRejectionEvent::toImpl(info.Holder());
|
| + ScriptPromise promise = event->promise(ScriptState::current(isolate));
|
| + if (promise.isEmpty()) {
|
| + v8SetReturnValue(info, v8::Null(isolate));
|
| + return;
|
| + }
|
| +
|
| + v8SetReturnValue(info, promise.v8Value());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|