| Index: third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
|
| index 6420acd0bc9b6e5c6d8c376259dede29824fdc0f..bad2d9a7f28353714dd0186b36f560f910e33db4 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp
|
| @@ -21,24 +21,6 @@ namespace blink {
|
|
|
| namespace {
|
|
|
| -// Unpacks |item|, stores the value of "done" member to |done| and returns
|
| -// the value of "value" member. Returns an empty handle when errored.
|
| -v8::MaybeLocal<v8::Value> unpack(ScriptState* scriptState, v8::Local<v8::Value> item, bool* done)
|
| -{
|
| - if (!item->IsObject()) {
|
| - V8ThrowException::throwTypeError(scriptState->isolate(), "The iteration item is not an object.");
|
| - return v8::MaybeLocal<v8::Value>();
|
| - }
|
| - v8::Local<v8::Object> object = item.As<v8::Object>();
|
| - v8::Local<v8::Value> doneValue;
|
| - if (!v8Call(object->Get(scriptState->context(), v8String(scriptState->isolate(), "done")), doneValue))
|
| - return v8::MaybeLocal<v8::Value>();
|
| - v8::MaybeLocal<v8::Value> r = object->Get(scriptState->context(), v8String(scriptState->isolate(), "value"));
|
| - if (!r.IsEmpty())
|
| - *done = doneValue->ToBoolean()->Value();
|
| - return r;
|
| -}
|
| -
|
| class NotReached : public ScriptFunction {
|
| public:
|
| static v8::Local<v8::Function> createFunction(ScriptState* scriptState)
|
| @@ -75,7 +57,8 @@ public:
|
| m_isSet = true;
|
| v8::TryCatch block(v.scriptState()->isolate());
|
| v8::Local<v8::Value> value;
|
| - if (!v8Call(unpack(v.scriptState(), v.v8Value(), &m_isDone), value)) {
|
| + v8::Local<v8::Value> item = v.v8Value();
|
| + if (!item->IsObject() || !v8Call(v8IterationItemUnpack(v.scriptState(), item.As<v8::Object>(), &m_isDone), value)) {
|
| m_isValid = false;
|
| return;
|
| }
|
|
|