OLD | NEW |
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 "onmouseenter" => 1, "onmouseleave" => 1, | 203 "onmouseenter" => 1, "onmouseleave" => 1, |
204 "onmousemove" => 1, "onmouseout" => 1, "onmouseov
er" => 1, | 204 "onmousemove" => 1, "onmouseout" => 1, "onmouseov
er" => 1, |
205 "onmouseup" => 1, "onresize" => 1, "onscroll" =>
1, | 205 "onmouseup" => 1, "onresize" => 1, "onscroll" =>
1, |
206 "onunload" => 1); | 206 "onunload" => 1); |
207 | 207 |
208 my %svgTypeNeedingTearOff = ( | 208 my %svgTypeNeedingTearOff = ( |
209 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>", | 209 "SVGAngle" => "SVGPropertyTearOff<SVGAngle>", |
210 "SVGLength" => "SVGPropertyTearOff<SVGLength>", | 210 "SVGLength" => "SVGPropertyTearOff<SVGLength>", |
211 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", | 211 "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>", |
212 "SVGMatrix" => "SVGPropertyTearOff<SVGMatrix>", | 212 "SVGMatrix" => "SVGPropertyTearOff<SVGMatrix>", |
213 "SVGNumber" => "SVGPropertyTearOff<float>", | 213 "SVGNumber" => "SVGPropertyTearOff<SVGNumber>", |
214 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", | 214 "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>", |
215 "SVGPathSegList" => "SVGPathSegListPropertyTearOff", | 215 "SVGPathSegList" => "SVGPathSegListPropertyTearOff", |
216 "SVGPoint" => "SVGPropertyTearOff<SVGPoint>", | 216 "SVGPoint" => "SVGPropertyTearOff<SVGPoint>", |
217 "SVGPointList" => "SVGListPropertyTearOff<SVGPointList>", | 217 "SVGPointList" => "SVGListPropertyTearOff<SVGPointList>", |
218 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", | 218 "SVGPreserveAspectRatio" => "SVGPropertyTearOff<SVGPreserveAspectRatio>", |
219 "SVGRect" => "SVGPropertyTearOff<FloatRect>", | 219 "SVGRect" => "SVGPropertyTearOff<FloatRect>", |
220 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>", | 220 "SVGStringList" => "SVGStaticListPropertyTearOff<SVGStringList>", |
221 "SVGTransform" => "SVGPropertyTearOff<SVGTransform>", | 221 "SVGTransform" => "SVGPropertyTearOff<SVGTransform>", |
222 "SVGTransformList" => "SVGTransformListPropertyTearOff" | 222 "SVGTransformList" => "SVGTransformListPropertyTearOff" |
223 ); | 223 ); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 | 412 |
413 sub SkipIncludeHeader | 413 sub SkipIncludeHeader |
414 { | 414 { |
415 my $type = shift; | 415 my $type = shift; |
416 | 416 |
417 return 1 if IsPrimitiveType($type); | 417 return 1 if IsPrimitiveType($type); |
418 return 1 if IsEnumType($type); | 418 return 1 if IsEnumType($type); |
419 return 1 if IsCallbackFunctionType($type); | 419 return 1 if IsCallbackFunctionType($type); |
420 return 1 if $type eq "DOMString"; | 420 return 1 if $type eq "DOMString"; |
421 | |
422 # Special case: SVGNumber.h does not exist. | |
423 return 1 if $type eq "SVGNumber"; | |
424 return 0; | 421 return 0; |
425 } | 422 } |
426 | 423 |
427 sub AddIncludesForType | 424 sub AddIncludesForType |
428 { | 425 { |
429 my $type = shift; | 426 my $type = shift; |
430 | 427 |
431 return if SkipIncludeHeader($type); | 428 return if SkipIncludeHeader($type); |
432 | 429 |
433 # Default includes | 430 # Default includes |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 508 |
512 $svgNativeType = GetSVGTypeNeedingTearOff($implType); | 509 $svgNativeType = GetSVGTypeNeedingTearOff($implType); |
513 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN
ativeType; | 510 return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgN
ativeType; |
514 | 511 |
515 # Append space to avoid compilation errors when using PassRefPtr<$svgNative
Type> | 512 # Append space to avoid compilation errors when using PassRefPtr<$svgNative
Type> |
516 $svgNativeType = "$svgNativeType "; | 513 $svgNativeType = "$svgNativeType "; |
517 | 514 |
518 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($implType); | 515 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($implType); |
519 if ($svgNativeType =~ /SVGPropertyTearOff/) { | 516 if ($svgNativeType =~ /SVGPropertyTearOff/) { |
520 $svgPropertyType = $svgWrappedNativeType; | 517 $svgPropertyType = $svgWrappedNativeType; |
521 AddToImplIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h"); | 518 AddToHeaderIncludes("core/svg/properties/SVGAnimatedPropertyTearOff.h"); |
522 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV
GStaticListPropertyTearOff/ or $svgNativeType =~ /SVGTransformListPropertyTearOf
f/) { | 519 } elsif ($svgNativeType =~ /SVGListPropertyTearOff/ or $svgNativeType =~ /SV
GStaticListPropertyTearOff/ or $svgNativeType =~ /SVGTransformListPropertyTearOf
f/) { |
523 $svgListPropertyType = $svgWrappedNativeType; | 520 $svgListPropertyType = $svgWrappedNativeType; |
524 AddToHeaderIncludes("core/svg/properties/SVGAnimatedListPropertyTearOff.
h"); | 521 AddToHeaderIncludes("core/svg/properties/SVGAnimatedListPropertyTearOff.
h"); |
525 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { | 522 } elsif ($svgNativeType =~ /SVGPathSegListPropertyTearOff/) { |
526 $svgListPropertyType = $svgWrappedNativeType; | 523 $svgListPropertyType = $svgWrappedNativeType; |
527 AddToHeaderIncludes("core/svg/properties/SVGPathSegListPropertyTearOff.h
"); | 524 AddToHeaderIncludes("core/svg/properties/SVGPathSegListPropertyTearOff.h
"); |
528 } | 525 } |
529 | 526 |
530 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); | 527 return ($svgPropertyType, $svgListPropertyType, $svgNativeType); |
531 } | 528 } |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 my $v8ClassName = GetV8ClassName($interface); | 1345 my $v8ClassName = GetV8ClassName($interface); |
1349 my $attrExt = $attribute->extendedAttributes; | 1346 my $attrExt = $attribute->extendedAttributes; |
1350 my $attrName = $attribute->name; | 1347 my $attrName = $attribute->name; |
1351 my $attrType = $attribute->type; | 1348 my $attrType = $attribute->type; |
1352 | 1349 |
1353 if (HasCustomGetter($attrExt)) { | 1350 if (HasCustomGetter($attrExt)) { |
1354 return; | 1351 return; |
1355 } | 1352 } |
1356 | 1353 |
1357 AssertNotSequenceType($attrType); | 1354 AssertNotSequenceType($attrType); |
1358 my $getterStringUsesImp = $interfaceName ne "SVGNumber"; | |
1359 my $nativeType = GetNativeType($attribute->type, $attribute->extendedAttribu
tes, ""); | 1355 my $nativeType = GetNativeType($attribute->type, $attribute->extendedAttribu
tes, ""); |
1360 my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName); | 1356 my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName); |
1361 | 1357 |
1362 my $conditionalString = GenerateConditionalString($attribute); | 1358 my $conditionalString = GenerateConditionalString($attribute); |
1363 my $code = ""; | 1359 my $code = ""; |
1364 $code .= "#if ${conditionalString}\n\n" if $conditionalString; | 1360 $code .= "#if ${conditionalString}\n\n" if $conditionalString; |
1365 $code .= <<END; | 1361 $code .= <<END; |
1366 static void ${attrName}AttrGetter${forMainWorldSuffix}(v8::Local<v8::String> nam
e, const v8::PropertyCallbackInfo<v8::Value>& info) | 1362 static void ${attrName}AttrGetter${forMainWorldSuffix}(v8::Local<v8::String> nam
e, const v8::PropertyCallbackInfo<v8::Value>& info) |
1367 { | 1363 { |
1368 END | 1364 END |
1369 if ($svgNativeType) { | 1365 if ($svgNativeType) { |
1370 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($interfaceNam
e); | 1366 my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($interfaceNam
e); |
1371 if ($svgWrappedNativeType =~ /List/) { | 1367 if ($svgWrappedNativeType =~ /List/) { |
1372 $code .= <<END; | 1368 $code .= <<END; |
1373 $svgNativeType* imp = ${v8ClassName}::toNative(info.Holder()); | 1369 $svgNativeType* imp = ${v8ClassName}::toNative(info.Holder()); |
1374 END | 1370 END |
1375 } else { | 1371 } else { |
1376 $code .= <<END; | 1372 $code .= <<END; |
1377 $svgNativeType* wrapper = ${v8ClassName}::toNative(info.Holder()); | 1373 $svgNativeType* wrapper = ${v8ClassName}::toNative(info.Holder()); |
1378 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); | 1374 $svgWrappedNativeType& impInstance = wrapper->propertyReference(); |
1379 END | |
1380 if ($getterStringUsesImp) { | |
1381 $code .= <<END; | |
1382 $svgWrappedNativeType* imp = &impInstance; | 1375 $svgWrappedNativeType* imp = &impInstance; |
1383 END | 1376 END |
1384 } | |
1385 } | 1377 } |
1386 } elsif ($attrExt->{"OnProto"} || $attrExt->{"Unforgeable"}) { | 1378 } elsif ($attrExt->{"OnProto"} || $attrExt->{"Unforgeable"}) { |
1387 if ($interfaceName eq "Window") { | 1379 if ($interfaceName eq "Window") { |
1388 $code .= <<END; | 1380 $code .= <<END; |
1389 v8::Handle<v8::Object> holder = info.Holder(); | 1381 v8::Handle<v8::Object> holder = info.Holder(); |
1390 END | 1382 END |
1391 } else { | 1383 } else { |
1392 # perform lookup first | 1384 # perform lookup first |
1393 $code .= <<END; | 1385 $code .= <<END; |
1394 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); | 1386 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${
v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); |
1395 if (holder.IsEmpty()) | 1387 if (holder.IsEmpty()) |
1396 return; | 1388 return; |
1397 END | 1389 END |
1398 } | 1390 } |
1399 $code .= <<END; | 1391 $code .= <<END; |
1400 ${implClassName}* imp = ${v8ClassName}::toNative(holder); | 1392 ${implClassName}* imp = ${v8ClassName}::toNative(holder); |
1401 END | 1393 END |
1402 } else { | 1394 } else { |
1403 my $reflect = $attribute->extendedAttributes->{"Reflect"}; | 1395 my $reflect = $attribute->extendedAttributes->{"Reflect"}; |
1404 my $url = $attribute->extendedAttributes->{"URL"}; | 1396 my $url = $attribute->extendedAttributes->{"URL"}; |
1405 if ($getterStringUsesImp && $reflect && !$url && InheritsInterface($inte
rface, "Node") && $attrType eq "DOMString") { | 1397 if ($reflect && !$url && InheritsInterface($interface, "Node") && $attrT
ype eq "DOMString") { |
1406 # Generate super-compact call for regular attribute getter: | 1398 # Generate super-compact call for regular attribute getter: |
1407 my ($functionName, @arguments) = GetterExpression($interfaceName, $a
ttribute); | 1399 my ($functionName, @arguments) = GetterExpression($interfaceName, $a
ttribute); |
1408 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; | 1400 $code .= " Element* imp = V8Element::toNative(info.Holder());\n"; |
1409 $code .= " v8SetReturnValue(info, v8String(imp->${functionName}("
. join(", ", @arguments) . "), info.GetIsolate(), ReturnUnsafeHandle));\n"; | 1401 $code .= " v8SetReturnValue(info, v8String(imp->${functionName}("
. join(", ", @arguments) . "), info.GetIsolate(), ReturnUnsafeHandle));\n"; |
1410 $code .= " return;\n"; | 1402 $code .= " return;\n"; |
1411 $code .= "}\n\n"; | 1403 $code .= "}\n\n"; |
1412 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; | 1404 $code .= "#endif // ${conditionalString}\n\n" if $conditionalString; |
1413 $implementation{nameSpaceInternal}->add($code); | 1405 $implementation{nameSpaceInternal}->add($code); |
1414 return; | 1406 return; |
1415 # Skip the rest of the function! | 1407 # Skip the rest of the function! |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 $code .= " ExceptionState es(info.GetIsolate());\n"; | 1439 $code .= " ExceptionState es(info.GetIsolate());\n"; |
1448 } | 1440 } |
1449 | 1441 |
1450 if ($isNullable) { | 1442 if ($isNullable) { |
1451 $code .= " bool isNull = false;\n"; | 1443 $code .= " bool isNull = false;\n"; |
1452 } | 1444 } |
1453 | 1445 |
1454 my $returnType = $attribute->type; | 1446 my $returnType = $attribute->type; |
1455 my $getterString; | 1447 my $getterString; |
1456 | 1448 |
1457 if ($getterStringUsesImp) { | 1449 my ($functionName, @arguments) = GetterExpression($interfaceName, $attribute
); |
1458 my ($functionName, @arguments) = GetterExpression($interfaceName, $attri
bute); | 1450 push(@arguments, "isNull") if $isNullable; |
1459 push(@arguments, "isNull") if $isNullable; | 1451 push(@arguments, "es") if $useExceptions; |
1460 push(@arguments, "es") if $useExceptions; | 1452 if ($attribute->extendedAttributes->{"ImplementedBy"}) { |
1461 if ($attribute->extendedAttributes->{"ImplementedBy"}) { | 1453 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"}; |
1462 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"
}; | 1454 my $implementedByImplName = GetImplNameFromImplementedBy($implementedBy)
; |
1463 my $implementedByImplName = GetImplNameFromImplementedBy($implemente
dBy); | 1455 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implementedBy
ImplName)); |
1464 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implement
edByImplName)); | 1456 unshift(@arguments, "imp") if !$attribute->isStatic; |
1465 unshift(@arguments, "imp") if !$attribute->isStatic; | 1457 $functionName = "${implementedByImplName}::${functionName}"; |
1466 $functionName = "${implementedByImplName}::${functionName}"; | 1458 } elsif ($attribute->isStatic) { |
1467 } elsif ($attribute->isStatic) { | 1459 $functionName = "${implClassName}::${functionName}"; |
1468 $functionName = "${implClassName}::${functionName}"; | |
1469 } else { | |
1470 $functionName = "imp->${functionName}"; | |
1471 } | |
1472 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{
"CallWith"}, " ", 0); | |
1473 $code .= $subCode; | |
1474 unshift(@arguments, @$arg); | |
1475 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; | |
1476 } else { | 1460 } else { |
1477 $getterString = "impInstance"; | 1461 $functionName = "imp->${functionName}"; |
1478 } | 1462 } |
| 1463 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{"Cal
lWith"}, " ", 0); |
| 1464 $code .= $subCode; |
| 1465 unshift(@arguments, @$arg); |
| 1466 $getterString = "${functionName}(" . join(", ", @arguments) . ")"; |
1479 | 1467 |
1480 my $expression; | 1468 my $expression; |
1481 if ($attribute->type eq "EventListener" && $interface->name eq "Window") { | 1469 if ($attribute->type eq "EventListener" && $interface->name eq "Window") { |
1482 $code .= " if (!imp->document())\n"; | 1470 $code .= " if (!imp->document())\n"; |
1483 $code .= " return;\n"; | 1471 $code .= " return;\n"; |
1484 } | 1472 } |
1485 | 1473 |
1486 if ($useExceptions || $isNullable) { | 1474 if ($useExceptions || $isNullable) { |
1487 if ($nativeType =~ /^V8StringResource/) { | 1475 if ($nativeType =~ /^V8StringResource/) { |
1488 $code .= " " . ConvertToV8StringResource($attribute, $nativeType,
"v", $getterString) . ";\n"; | 1476 $code .= " " . ConvertToV8StringResource($attribute, $nativeType,
"v", $getterString) . ";\n"; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 | 1864 |
1877 $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->extendedAt
tributes); | 1865 $code .= GenerateCustomElementInvocationScopeIfNeeded($attribute->extendedAt
tributes); |
1878 | 1866 |
1879 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep
tion"} || $attribute->extendedAttributes->{"RaisesException"}; | 1867 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep
tion"} || $attribute->extendedAttributes->{"RaisesException"}; |
1880 | 1868 |
1881 if ($useExceptions) { | 1869 if ($useExceptions) { |
1882 AddToImplIncludes("bindings/v8/ExceptionState.h"); | 1870 AddToImplIncludes("bindings/v8/ExceptionState.h"); |
1883 $code .= " ExceptionState es(info.GetIsolate());\n"; | 1871 $code .= " ExceptionState es(info.GetIsolate());\n"; |
1884 } | 1872 } |
1885 | 1873 |
1886 if ($interfaceName eq "SVGNumber") { | 1874 if ($attribute->type eq "EventListener") { |
1887 $code .= " *imp = $expression;\n"; | 1875 my $implSetterFunctionName = FirstLetterToUpperCase($attrName); |
| 1876 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); |
| 1877 if (!InheritsInterface($interface, "Node")) { |
| 1878 my $attrImplName = GetImplName($attribute); |
| 1879 $code .= " transferHiddenDependency(info.Holder(), imp->${attrImp
lName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::event
ListenerCacheIndex, info.GetIsolate());\n"; |
| 1880 } |
| 1881 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); |
| 1882 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalScope"
) and $attribute->name eq "onerror") { |
| 1883 AddToImplIncludes("bindings/v8/V8ErrorHandler.h"); |
| 1884 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::f
indOrCreateWrapper<V8ErrorHandler>(value, true), isolatedWorldForIsolate(info.Ge
tIsolate()));\n"; |
| 1885 } else { |
| 1886 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::g
etEventListener(value, true, ListenerFindOrCreate), isolatedWorldForIsolate(info
.GetIsolate()));\n"; |
| 1887 } |
1888 } else { | 1888 } else { |
1889 if ($attribute->type eq "EventListener") { | 1889 my ($functionName, @arguments) = SetterExpression($interfaceName, $attri
bute); |
1890 my $implSetterFunctionName = FirstLetterToUpperCase($attrName); | 1890 push(@arguments, $expression); |
1891 AddToImplIncludes("bindings/v8/V8AbstractEventListener.h"); | 1891 push(@arguments, "es") if $useExceptions; |
1892 if (!InheritsInterface($interface, "Node")) { | 1892 if ($attribute->extendedAttributes->{"ImplementedBy"}) { |
1893 my $attrImplName = GetImplName($attribute); | 1893 my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"
}; |
1894 $code .= " transferHiddenDependency(info.Holder(), imp->${att
rImplName}(isolatedWorldForIsolate(info.GetIsolate())), value, ${v8ClassName}::e
ventListenerCacheIndex, info.GetIsolate());\n"; | 1894 my $implementedByImplName = GetImplNameFromImplementedBy($implemente
dBy); |
1895 } | 1895 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $implement
edByImplName)); |
1896 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); | 1896 unshift(@arguments, "imp") if !$attribute->isStatic; |
1897 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalSc
ope") and $attribute->name eq "onerror") { | 1897 $functionName = "${implementedByImplName}::${functionName}"; |
1898 AddToImplIncludes("bindings/v8/V8ErrorHandler.h"); | 1898 } elsif ($attribute->isStatic) { |
1899 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::findOrCreateWrapper<V8ErrorHandler>(value, true), isolatedWorldForIsolate(inf
o.GetIsolate()));\n"; | 1899 $functionName = "${implClassName}::${functionName}"; |
1900 } else { | |
1901 $code .= " imp->set$implSetterFunctionName(V8EventListenerLis
t::getEventListener(value, true, ListenerFindOrCreate), isolatedWorldForIsolate(
info.GetIsolate()));\n"; | |
1902 } | |
1903 } else { | 1900 } else { |
1904 my ($functionName, @arguments) = SetterExpression($interfaceName, $a
ttribute); | 1901 $functionName = "imp->${functionName}"; |
1905 push(@arguments, $expression); | |
1906 push(@arguments, "es") if $useExceptions; | |
1907 if ($attribute->extendedAttributes->{"ImplementedBy"}) { | |
1908 my $implementedBy = $attribute->extendedAttributes->{"Implemente
dBy"}; | |
1909 my $implementedByImplName = GetImplNameFromImplementedBy($implem
entedBy); | |
1910 AddToImplIncludes(HeaderFilesForInterface($implementedBy, $imple
mentedByImplName)); | |
1911 unshift(@arguments, "imp") if !$attribute->isStatic; | |
1912 $functionName = "${implementedByImplName}::${functionName}"; | |
1913 } elsif ($attribute->isStatic) { | |
1914 $functionName = "${implClassName}::${functionName}"; | |
1915 } else { | |
1916 $functionName = "imp->${functionName}"; | |
1917 } | |
1918 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttribute
s->{"SetterCallWith"} || $attribute->extendedAttributes->{"CallWith"}, " ", 1
); | |
1919 $code .= $subCode; | |
1920 unshift(@arguments, @$arg); | |
1921 $code .= " ${functionName}(" . join(", ", @arguments) . ");\n"; | |
1922 } | 1902 } |
| 1903 my ($arg, $subCode) = GenerateCallWith($attribute->extendedAttributes->{
"SetterCallWith"} || $attribute->extendedAttributes->{"CallWith"}, " ", 1); |
| 1904 $code .= $subCode; |
| 1905 unshift(@arguments, @$arg); |
| 1906 $code .= " ${functionName}(" . join(", ", @arguments) . ");\n"; |
1923 } | 1907 } |
1924 | 1908 |
1925 if ($useExceptions) { | 1909 if ($useExceptions) { |
1926 $code .= " es.throwIfNeeded();\n"; | 1910 $code .= " es.throwIfNeeded();\n"; |
1927 } | 1911 } |
1928 | 1912 |
1929 if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"},
"ScriptState")) { | 1913 if (ExtendedAttributeContains($attribute->extendedAttributes->{"CallWith"},
"ScriptState")) { |
1930 $code .= " if (state.hadException())\n"; | 1914 $code .= " if (state.hadException())\n"; |
1931 $code .= " throwError(state.exception(), info.GetIsolate());\n"; | 1915 $code .= " throwError(state.exception(), info.GetIsolate());\n"; |
1932 } | 1916 } |
(...skipping 4095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6028 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { | 6012 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { |
6029 $found = 1; | 6013 $found = 1; |
6030 } | 6014 } |
6031 return 1 if $found; | 6015 return 1 if $found; |
6032 }, 0); | 6016 }, 0); |
6033 | 6017 |
6034 return $found; | 6018 return $found; |
6035 } | 6019 } |
6036 | 6020 |
6037 1; | 6021 1; |
OLD | NEW |