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

Side by Side Diff: Source/bindings/scripts/CodeGeneratorV8.pm

Issue 15690020: [binding] Check own property on named property accessor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 6 months 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 3376 matching lines...) Expand 10 before | Expand all | Expand 10 after
3387 my $raisesExceptions = $namedGetterFunction->signature->extendedAttributes-> {"RaisesException"}; 3387 my $raisesExceptions = $namedGetterFunction->signature->extendedAttributes-> {"RaisesException"};
3388 my $methodCallCode = GenerateMethodCall($returnType, "element", "collection- >${methodName}", "propertyName", $raisesExceptions); 3388 my $methodCallCode = GenerateMethodCall($returnType, "element", "collection- >${methodName}", "propertyName", $raisesExceptions);
3389 3389
3390 my $code = "v8::Handle<v8::Value> ${v8ClassName}::namedPropertyGetter(v8::Lo cal<v8::String> name, const v8::AccessorInfo& info)\n"; 3390 my $code = "v8::Handle<v8::Value> ${v8ClassName}::namedPropertyGetter(v8::Lo cal<v8::String> name, const v8::AccessorInfo& info)\n";
3391 $code .= "{\n"; 3391 $code .= "{\n";
3392 if (!$namedGetterFunction->signature->extendedAttributes->{"OverrideBuiltins "}) { 3392 if (!$namedGetterFunction->signature->extendedAttributes->{"OverrideBuiltins "}) {
3393 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n"; 3393 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n";
3394 $code .= " return v8Undefined();\n"; 3394 $code .= " return v8Undefined();\n";
3395 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n"; 3395 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n";
3396 $code .= " return v8Undefined();\n"; 3396 $code .= " return v8Undefined();\n";
3397 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
3398 $code .= " return v8Undefined();\n";
haraken 2013/05/30 10:23:09 I got a bit confused. I thought you were saying th
3397 } 3399 }
3398 $code .= "\n"; 3400 $code .= "\n";
3399 $code .= " ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));\n"; 3401 $code .= " ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));\n";
3400 $code .= " ${implClassName}* collection = toNative(info.Holder());\n"; 3402 $code .= " ${implClassName}* collection = toNative(info.Holder());\n";
3401 $code .= " AtomicString propertyName = toWebCoreAtomicString(name);\n"; 3403 $code .= " AtomicString propertyName = toWebCoreAtomicString(name);\n";
3402 if ($raisesExceptions) { 3404 if ($raisesExceptions) {
3403 $code .= " ExceptionCode ec = 0;\n"; 3405 $code .= " ExceptionCode ec = 0;\n";
3404 } 3406 }
3405 $code .= $methodCallCode . "\n"; 3407 $code .= $methodCallCode . "\n";
3406 if ($raisesExceptions) { 3408 if ($raisesExceptions) {
(...skipping 26 matching lines...) Expand all
3433 my $raisesExceptions = $namedSetterFunction->signature->extendedAttributes-> {"RaisesException"}; 3435 my $raisesExceptions = $namedSetterFunction->signature->extendedAttributes-> {"RaisesException"};
3434 my $nativeValue = JSValueToNative($type, $namedSetterFunction->signature->ex tendedAttributes, "value", "info.GetIsolate()"); 3436 my $nativeValue = JSValueToNative($type, $namedSetterFunction->signature->ex tendedAttributes, "value", "info.GetIsolate()");
3435 3437
3436 my $code = "v8::Handle<v8::Value> ${v8ClassName}::namedPropertySetter(v8::Lo cal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\ n"; 3438 my $code = "v8::Handle<v8::Value> ${v8ClassName}::namedPropertySetter(v8::Lo cal<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)\ n";
3437 $code .= "{\n"; 3439 $code .= "{\n";
3438 if (!$namedSetterFunction->signature->extendedAttributes->{"OverrideBuiltins "}) { 3440 if (!$namedSetterFunction->signature->extendedAttributes->{"OverrideBuiltins "}) {
3439 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n"; 3441 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n";
3440 $code .= " return v8Undefined();\n"; 3442 $code .= " return v8Undefined();\n";
3441 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n"; 3443 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n";
3442 $code .= " return v8Undefined();\n"; 3444 $code .= " return v8Undefined();\n";
3445 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
3446 $code .= " return v8Undefined();\n";
3443 } 3447 }
3444 $code .= " ${implClassName}* collection = toNative(info.Holder());\n"; 3448 $code .= " ${implClassName}* collection = toNative(info.Holder());\n";
3445 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, propertyNa me, name);\n"; 3449 $code .= " V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, propertyNa me, name);\n";
3446 my $extraArguments = ""; 3450 my $extraArguments = "";
3447 if ($raisesExceptions) { 3451 if ($raisesExceptions) {
3448 $code .= " ExceptionCode ec = 0;\n"; 3452 $code .= " ExceptionCode ec = 0;\n";
3449 $extraArguments = ", ec"; 3453 $extraArguments = ", ec";
3450 } 3454 }
3451 if ($type eq "DOMString") { 3455 if ($type eq "DOMString") {
3452 my $nullCheck = ""; 3456 my $nullCheck = "";
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
5654 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 5658 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
5655 $found = 1; 5659 $found = 1;
5656 } 5660 }
5657 return 1 if $found; 5661 return 1 if $found;
5658 }, 0); 5662 }, 0);
5659 5663
5660 return $found; 5664 return $found;
5661 } 5665 }
5662 5666
5663 1; 5667 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698