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

Unified Diff: Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp

Issue 724733002: Support for [Clamp] and [EnforceRange] to IDL dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
diff --git a/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp b/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
index ad418437631d4c777e439bee8511ab696db2bac8..48b927f14b6af35bd22dc54e479c46349ee46ccd 100644
--- a/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
+++ b/Source/bindings/tests/results/core/V8TestDictionaryDerived.cpp
@@ -7,7 +7,6 @@
#include "config.h"
#include "V8TestDictionaryDerivedImplementedAs.h"
-#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8TestDictionary.h"
@@ -26,26 +25,23 @@ void V8TestDictionaryDerivedImplementedAs::toImpl(v8::Isolate* isolate, v8::Hand
if (exceptionState.hadException())
return;
- // FIXME: Do not use Dictionary and DictionaryHelper
- // https://crbug.com/321462
- Dictionary dictionary(v8Value, isolate);
- // FIXME: Remove this v8::TryCatch once the code is switched from
- // Dictionary/DictionaryHelper to something that uses ExceptionState.
+
+ v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
v8::TryCatch block;
- String derivedStringMember;
- if (DictionaryHelper::getWithUndefinedOrNullCheck(dictionary, "derivedStringMember", derivedStringMember)) {
+ v8::Local<v8::Value> derivedStringMemberValue = v8Object->Get(v8String(isolate, "derivedStringMember"));
+ if (!derivedStringMemberValue.IsEmpty() && !isUndefinedOrNull(derivedStringMemberValue)) {
+ TOSTRING_VOID(V8StringResource<>, derivedStringMember, derivedStringMemberValue);
impl.setDerivedStringMember(derivedStringMember);
} else if (block.HasCaught()) {
exceptionState.rethrowV8Exception(block.Exception());
- return;
}
- String derivedStringMemberWithDefault;
- if (DictionaryHelper::getWithUndefinedOrNullCheck(dictionary, "derivedStringMemberWithDefault", derivedStringMemberWithDefault)) {
+ v8::Local<v8::Value> derivedStringMemberWithDefaultValue = v8Object->Get(v8String(isolate, "derivedStringMemberWithDefault"));
+ if (!derivedStringMemberWithDefaultValue.IsEmpty() && !isUndefinedOrNull(derivedStringMemberWithDefaultValue)) {
+ TOSTRING_VOID(V8StringResource<>, derivedStringMemberWithDefault, derivedStringMemberWithDefaultValue);
impl.setDerivedStringMemberWithDefault(derivedStringMemberWithDefault);
} else if (block.HasCaught()) {
exceptionState.rethrowV8Exception(block.Exception());
- return;
}
}

Powered by Google App Engine
This is Rietveld 408576698