Chromium Code Reviews

Unified Diff: Source/core/testing/Internals.cpp

Issue 513203002: Introduce MIDIInputMap and MIDIOutputMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@iterator-adhoc
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index f8b806bd530597e029357096369edb6a680e3de3..b27a091819a919b911bcdce3bf8b900fdacebb43 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -154,14 +154,11 @@ public:
virtual ScriptValue next(ScriptState* scriptState, ExceptionState& exceptionState) OVERRIDE
{
v8::Isolate* isolate = scriptState->isolate();
- v8::Local<v8::Value> value = v8::Integer::New(isolate, m_current * m_current);
- bool done = (m_current >= 5);
+ int value = m_current * m_current;
+ if (m_current >= 5)
+ return ScriptValue(scriptState, v8DoneIteratorResult(isolate));
++m_current;
-
- v8::Local<v8::Object> result = v8::Object::New(isolate);
- result->Set(v8String(isolate, "value"), value);
- result->Set(v8String(isolate, "done"), v8Boolean(done, isolate));
- return ScriptValue(scriptState, result);
+ return ScriptValue(scriptState, v8IteratorResult(scriptState, value));
}
virtual ScriptValue next(ScriptState* scriptState, ScriptValue value, ExceptionState& exceptionState) OVERRIDE
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine