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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp

Issue 2587383002: Add [PrefixGet] extended attribute (Closed)
Patch Set: Created 4 years 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: third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
index 0e9a161dc4d223a01289d89ffe1a497056fe9105..49ca5771104086a3c858a8b80bcabdf673804a6f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp
@@ -319,6 +319,22 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
impl.setOtherDoubleOrStringMember(otherDoubleOrStringMember);
}
+ v8::Local<v8::Value> prefixGetMemberValue;
+ if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "prefixGetMember")).ToLocal(&prefixGetMemberValue)) {
+ exceptionState.rethrowV8Exception(block.Exception());
+ return;
+ }
+ if (prefixGetMemberValue.IsEmpty() || prefixGetMemberValue->IsUndefined()) {
+ // Do nothing.
+ } else {
+ ScriptValue prefixGetMember = ScriptValue(ScriptState::current(isolate), prefixGetMemberValue);
+ if (!prefixGetMember.isObject()) {
+ exceptionState.throwTypeError("member prefixGetMember is not an object.");
+ return;
+ }
+ impl.setPrefixGetMember(prefixGetMember);
+ }
+
v8::Local<v8::Value> restrictedDoubleMemberValue;
if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "restrictedDoubleMember")).ToLocal(&restrictedDoubleMemberValue)) {
exceptionState.rethrowV8Exception(block.Exception());
@@ -683,6 +699,12 @@ bool toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio
return false;
}
+ if (impl.hasPrefixGetMember()) {
+ DCHECK(impl.getPrefixGetMember().isObject());
+ if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "prefixGetMember"), impl.getPrefixGetMember().v8Value())))
+ return false;
+ }
+
if (impl.hasRestrictedDoubleMember()) {
if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "restrictedDoubleMember"), v8::Number::New(isolate, impl.restrictedDoubleMember()))))
return false;

Powered by Google App Engine
This is Rietveld 408576698