Diff
Modified: trunk/LayoutTests/ChangeLog (199264 => 199265)
--- trunk/LayoutTests/ChangeLog 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/LayoutTests/ChangeLog 2016-04-09 03:46:25 UTC (rev 199265)
@@ -1,3 +1,14 @@
+2016-04-07 Darin Adler <[email protected]>
+
+ Improve IDL support for object arguments that are neither optional nor nullable
+ https://bugs.webkit.org/show_bug.cgi?id=156149
+
+ Reviewed by Chris Dumez.
+
+ * fast/canvas/canvas-path-addPath-expected.txt: Updated expected result to expect
+ TypeError rather than TYPE_MISMATCH_ERR. A progression.
+ * fast/text/font-face-set-_javascript_-expected.txt: Ditto.
+
2016-04-08 Joseph Pecoraro <[email protected]>
Web Inspector: XHRs and Web Worker scripts are not searchable
Modified: trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt (199264 => 199265)
--- trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/LayoutTests/fast/canvas/canvas-path-addPath-expected.txt 2016-04-09 03:46:25 UTC (rev 199265)
@@ -31,12 +31,12 @@
PASS refTest(result.data, expected.data) is true
Various tests of invalid values.
-PASS pathA.addPath(matrix, pathB) threw exception Error: TypeMismatchError: DOM Exception 17.
-PASS pathA.addPath(pathB, ctx.canvas) threw exception Error: TypeMismatchError: DOM Exception 17.
-PASS pathA.addPath(pathB, null) threw exception Error: TypeMismatchError: DOM Exception 17.
-PASS pathA.addPath(pathB, undefined) threw exception Error: TypeMismatchError: DOM Exception 17.
-PASS pathA.addPath(pathB, 0) threw exception Error: TypeMismatchError: DOM Exception 17.
-PASS pathA.addPath(pathB, "0") threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS pathA.addPath(matrix, pathB) threw exception TypeError: Type error.
+PASS pathA.addPath(pathB, ctx.canvas) threw exception TypeError: Type error.
+PASS pathA.addPath(pathB, null) threw exception TypeError: Type error.
+PASS pathA.addPath(pathB, undefined) threw exception TypeError: Type error.
+PASS pathA.addPath(pathB, 0) threw exception TypeError: Type error.
+PASS pathA.addPath(pathB, "0") threw exception TypeError: Type error.
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt (199264 => 199265)
--- trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/LayoutTests/fast/text/font-face-set-_javascript_-expected.txt 2016-04-09 03:46:25 UTC (rev 199265)
@@ -13,7 +13,7 @@
PASS item.done is true
PASS fontFaceSet.add(fontFace2) is fontFaceSet
PASS fontFaceSet.size is 2
-PASS fontFaceSet.add(null) threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS fontFaceSet.add(null) threw exception TypeError: Type error.
PASS item.done is false
PASS item.value is fontFace1
PASS item.done is false
@@ -21,10 +21,10 @@
PASS item.done is true
PASS fontFaceSet.delete(fontFace1) is true
PASS fontFaceSet.delete(fontFace3) is false
-PASS fontFaceSet.delete(null) threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS fontFaceSet.delete(null) threw exception TypeError: Type error.
PASS fontFaceSet.has(fontFace1) is false
PASS fontFaceSet.has(fontFace2) is true
-PASS fontFaceSet.has(null) threw exception Error: TypeMismatchError: DOM Exception 17.
+PASS fontFaceSet.has(null) threw exception TypeError: Type error.
PASS fontFaceSet.size is 0
PASS fontFaceSet.values().next().done is true
PASS fontFaceSet.check('garbage') threw exception Error: SyntaxError: DOM Exception 12.
Modified: trunk/Source/WebCore/ChangeLog (199264 => 199265)
--- trunk/Source/WebCore/ChangeLog 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/ChangeLog 2016-04-09 03:46:25 UTC (rev 199265)
@@ -1,3 +1,83 @@
+2016-04-07 Darin Adler <[email protected]>
+
+ Improve IDL support for object arguments that are neither optional nor nullable
+ https://bugs.webkit.org/show_bug.cgi?id=156149
+
+ Reviewed by Chris Dumez.
+
+ After this patch, we are almost ready to change some more DOM functions to
+ use references instead of pointers. Remaining blocking issue is lack of support
+ for ShouldPassWrapperByReference in the gobject bindings.
+
+ * bindings/objc/ExceptionHandlers.h: Add NO_RETURN to raiseDOMException.
+ Added a new raiseTypeErrorException. Re-indented header and removed unneeded
+ include and forward declarations.
+
+ * bindings/objc/ExceptionHandlers.mm:
+ (WebCore::raiseDOMException): Added RELEASE_ASSERT_NOT_REACHED so the compiler
+ will understand this is NO_RETURN. Also updated FIXME comment.
+ (WebCore::raiseTypeErrorException): Added.
+
+ * bindings/scripts/CodeGenerator.pm: Removed unneeded code that allows the type
+ "AtomicString" in IDL files.
+ (ShouldPassWrapperByReference): Added. Contains the logic from the function in
+ the _javascript_ code generator that was named IsPointerParameterPassedByReference,
+ minus a couple checks that are unneeded. For use in other code generators so they
+ are all consistent about how they call the DOM implementation.
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ (SkipFunction): Removed support for unused CustomBinding extended attribute.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateHeader): Removed support for unused CustomBinding extended attribute.
+ (GenerateImplementation): Ditto. Also changed type checking code to throw a
+ type error in a more efficient way, using throwVMTypeError directly.
+ (GenerateParametersCheck): Rearranged code a bit so that arguments that need to
+ be passed in unusual ways are handled all in one place. Use WTFMove for newly
+ created NodeFilter objects. Simplified the reference logic so it doesn't need
+ to do an additional check to see if a type is a callback. Also changed type
+ checking code to throw a type error in a more efficient way, using throwVMTypeError
+ directly. Also corrected mistake where null checking code was throwing
+ TYPE_MISMATCH_ERR instead of a type error.
+ (GetNativeType): Coding style tweak.
+ (ShouldPassWrapperByReference): Renamed from IsPointerParameterPassedByReference.
+ Changed to call underlying ShouldPassWrapperByReference function in the language-
+ independent code generator.
+ (GenerateConstructorDefinition): Updated for name change.
+
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ (SkipFunction): Removed support for unused CustomBinding extended attribute.
+ (GenerateImplementation): Added code to null check and pass a reference when
+ ShouldPassWrapperByReference returns true.
+
+ * bindings/scripts/IDLAttributes.txt: Sorted in the AppleCopyright and
+ UsePointersEvenForNonNullableObjectArguments arguments. Removed the unused
+ CPPPureInterface and CustomBinding attributes.
+
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Regenerated test results.
+ * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.h: Ditto.
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestCallback.mm: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
+
+ * bindings/scripts/test/TestObj.idl: Removed test for CustomBinding.
+
+ * dom/DOMImplementation.idl: Fixed #if so that only the return type is different
+ between _javascript_ and the other bindings. Without this change, the different
+ bindings got different results for ShouldPassWrapperByReference. Also formatted
+ functions all on a single line.
+
+ * dom/EventListener.idl: Removed CPPPureInterface, since it had no effect.
+ * dom/EventTarget.idl: Ditto.
+
2016-04-08 Chris Dumez <[email protected]>
[WebIDL] Add support for [ExportMacro=XXX] IDL extended attribute
Modified: trunk/Source/WebCore/bindings/objc/ExceptionHandlers.h (199264 => 199265)
--- trunk/Source/WebCore/bindings/objc/ExceptionHandlers.h 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/objc/ExceptionHandlers.h 2016-04-09 03:46:25 UTC (rev 199265)
@@ -26,23 +26,21 @@
#ifndef ExceptionHandlers_h
#define ExceptionHandlers_h
-#include <wtf/Assertions.h>
-
namespace WebCore {
- typedef int ExceptionCode;
-
- class FrameSelection;
- class Range;
+typedef int ExceptionCode;
- void raiseDOMException(ExceptionCode);
+NO_RETURN void raiseDOMException(ExceptionCode);
+NO_RETURN void raiseTypeErrorException();
- inline void raiseOnDOMError(ExceptionCode ec)
- {
- if (ec)
- raiseDOMException(ec);
- }
+void raiseOnDOMError(ExceptionCode);
+inline void raiseOnDOMError(ExceptionCode code)
+{
+ if (code)
+ raiseDOMException(code);
+}
+
} // namespace WebCore
#endif // ExceptionHandlers_h
Modified: trunk/Source/WebCore/bindings/objc/ExceptionHandlers.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/objc/ExceptionHandlers.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/objc/ExceptionHandlers.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -42,8 +42,8 @@
ExceptionCodeDescription description(ec);
+ // FIXME: This should use type and code exclusively and not try to use typeName.
NSString *exceptionName;
- // FIXME: We can use the enum to do these comparisons faster.
if (strcmp(description.typeName, "DOM Range") == 0)
exceptionName = DOMRangeException;
else if (strcmp(description.typeName, "DOM Events") == 0)
@@ -67,6 +67,13 @@
[userInfo release];
[exception raise];
+
+ RELEASE_ASSERT_NOT_REACHED();
}
+void raiseTypeErrorException()
+{
+ raiseDOMException(TypeError);
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -53,7 +53,7 @@
my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
-my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1);
+my %stringTypeHash = ("DOMString" => 1);
# WebCore types used directly in IDL files.
my %webCoreTypeHash = (
@@ -886,4 +886,18 @@
return $found;
}
+sub ShouldPassWrapperByReference
+{
+ my $object = shift;
+ my $parameter = shift;
+ my $interface = shift;
+
+ return 0 if $parameter->isVariadic;
+ return 0 if $parameter->isNullable;
+ return 0 if $parameter->isOptional and $parameter->extendedAttributes->{"Default"} and $parameter->extendedAttributes->{"Default"} eq "Undefined";
+ return 0 if !$object->IsWrapperType($parameter->type) && !$object->IsTypedArrayType($parameter->type);
+ return 0 if $interface->extendedAttributes->{"UsePointersEvenForNonNullableObjectArguments"};
+ return 1;
+}
+
1;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -299,7 +299,7 @@
my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($function->signature->name);
my $functionReturnType = $prefix eq "set_" ? "void" : $function->signature->type;
- my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"} || $function->signature->extendedAttributes->{"CustomBinding"};
+ my $isCustomFunction = $function->signature->extendedAttributes->{"Custom"};
my $callWith = $function->signature->extendedAttributes->{"CallWith"};
my $isUnsupportedCallWith = $codeGenerator->ExtendedAttributeContains($callWith, "ScriptArguments") || $codeGenerator->ExtendedAttributeContains($callWith, "CallStack") || $codeGenerator->ExtendedAttributeContains($callWith, "FirstWindow") || $codeGenerator->ExtendedAttributeContains($callWith, "ActiveWindow");
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -1154,7 +1154,7 @@
foreach my $function (@{$interface->functions}) {
$numCustomFunctions++ if HasCustomMethod($function->signature->extendedAttributes);
- if ($function->signature->extendedAttributes->{"ForwardDeclareInHeader"} or $function->signature->extendedAttributes->{"CustomBinding"}) {
+ if ($function->signature->extendedAttributes->{"ForwardDeclareInHeader"}) {
$hasForwardDeclaringFunctions = 1;
}
}
@@ -1293,7 +1293,7 @@
push(@headerContent,"// Functions\n\n");
foreach my $function (@{$interface->functions}) {
next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
- next unless $function->signature->extendedAttributes->{"ForwardDeclareInHeader"} or $function->signature->extendedAttributes->{"CustomBinding"};
+ next unless $function->signature->extendedAttributes->{"ForwardDeclareInHeader"};
my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"};
if ($needsAppleCopyright) {
@@ -1850,7 +1850,6 @@
foreach my $function (@functions) {
next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
next if $function->signature->extendedAttributes->{"ForwardDeclareInHeader"};
- next if $function->signature->extendedAttributes->{"CustomBinding"};
next if IsJSBuiltin($interface, $function);
my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"};
@@ -2796,7 +2795,7 @@
if ($attribute->signature->type eq "double" or $attribute->signature->type eq "float") {
push(@implContent, " if (!std::isfinite(nativeValue)) {\n");
- push(@implContent, " setDOMException(state, TypeError);\n");
+ push(@implContent, " throwVMTypeError(state);\n");
push(@implContent, " return false;\n");
push(@implContent, " }\n");
}
@@ -2899,7 +2898,6 @@
if ($numFunctions > 0) {
my $inAppleCopyright = 0;
foreach my $function (@{$interface->functions}) {
- next if $function->signature->extendedAttributes->{"CustomBinding"};
next if IsJSBuiltin($interface, $function);
my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"};
if ($needsAppleCopyright) {
@@ -3425,12 +3423,13 @@
$implIncludes{"JSDOMBinding.h"} = 1;
foreach my $parameter (@{$function->parameters}) {
my $argType = $parameter->type;
+
# Optional arguments with [Optional] should generate an early call with fewer arguments.
# Optional arguments with [Optional=...] should not generate the early call.
# Optional Dictionary arguments always considered to have default of empty dictionary.
my $optional = $parameter->isOptional;
my $defaultAttribute = $parameter->extendedAttributes->{"Default"};
- if ($optional && !$defaultAttribute && $argType ne "Dictionary" && !$codeGenerator->IsCallbackInterface($parameter->type)) {
+ if ($optional && !$defaultAttribute && $argType ne "Dictionary" && !$codeGenerator->IsCallbackInterface($argType)) {
# Generate early call if there are enough parameters.
if (!$hasOptionalArguments) {
push(@$outputArray, "\n size_t argsCount = state->argumentCount();\n");
@@ -3446,6 +3445,7 @@
}
my $name = $parameter->name;
+ my $value = $name;
if ($argType eq "XPathNSResolver") {
push(@$outputArray, " RefPtr<XPathNSResolver> customResolver;\n");
@@ -3456,13 +3456,13 @@
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
push(@$outputArray, " resolver = customResolver.get();\n");
push(@$outputArray, " }\n");
- } elsif ($codeGenerator->IsCallbackInterface($parameter->type)) {
+ } elsif ($codeGenerator->IsCallbackInterface($argType)) {
my $callbackClassName = GetCallbackClassName($argType);
$implIncludes{"$callbackClassName.h"} = 1;
if ($optional) {
push(@$outputArray, " RefPtr<$argType> $name;\n");
push(@$outputArray, " if (!state->argument($argsIndex).isUndefinedOrNull()) {\n");
- if ($codeGenerator->IsFunctionOnlyCallbackInterface($parameter->type)) {
+ if ($codeGenerator->IsFunctionOnlyCallbackInterface($argType)) {
push(@$outputArray, " if (!state->uncheckedArgument($argsIndex).isFunction())\n");
} else {
push(@$outputArray, " if (!state->uncheckedArgument($argsIndex).isObject())\n");
@@ -3476,7 +3476,7 @@
}
push(@$outputArray, " }\n");
} else {
- if ($codeGenerator->IsFunctionOnlyCallbackInterface($parameter->type)) {
+ if ($codeGenerator->IsFunctionOnlyCallbackInterface($argType)) {
push(@$outputArray, " if (!state->argument($argsIndex).isFunction())\n");
} else {
push(@$outputArray, " if (!state->argument($argsIndex).isObject())\n");
@@ -3489,6 +3489,7 @@
push(@$outputArray, " RefPtr<$argType> $name = ${callbackClassName}::create(asObject(state->uncheckedArgument($argsIndex)), castedThis->globalObject());\n");
}
}
+ $value = "WTFMove($name)";
} elsif ($parameter->extendedAttributes->{"Clamp"}) {
my $nativeValue = "${name}NativeValue";
push(@$outputArray, " $argType $name = 0;\n");
@@ -3518,7 +3519,6 @@
push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
}
-
} elsif ($codeGenerator->IsEnumType($argType)) {
$implIncludes{"<runtime/Error.h>"} = 1;
@@ -3603,30 +3603,22 @@
push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- if (IsPointerParameterPassedByReference($parameter, $interface) or ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $interfaceName =~ /List$/)) {
- push(@$outputArray, " if (!$name) {\n");
- push(@$outputArray, " setDOMException(state, TYPE_MISMATCH_ERR);\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- push(@$outputArray, " }\n");
+ my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($argType) && $interfaceName !~ /List$/;
+ if ($isTearOff or ShouldPassWrapperByReference($parameter, $interface)) {
+ push(@$outputArray, " if (!$name)\n");
+ push(@$outputArray, " return throwVMTypeError(state);\n");
+ $value = $isTearOff ? "$name->propertyReference()" : "*$name";
}
- if ($parameter->type eq "double" or $parameter->type eq "float") {
- push(@$outputArray, " if (!std::isfinite($name)) {\n");
- push(@$outputArray, " setDOMException(state, TypeError);\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- push(@$outputArray, " }\n");
+ if ($argType eq "double" or $argType eq "float") {
+ push(@$outputArray, " if (!std::isfinite($name))\n");
+ push(@$outputArray, " return throwVMTypeError(state);\n");
}
- }
- if ($argType eq "NodeFilter" || ($codeGenerator->IsTypedArrayType($argType) and not $argType eq "ArrayBuffer")) {
- push @arguments, "$name.get()";
- } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $interfaceName =~ /List$/) {
- push @arguments, "$name->propertyReference()";
- } elsif (IsPointerParameterPassedByReference($parameter, $interface)) {
- push @arguments, "*$name";
- } else {
- push @arguments, $name;
+ $value = "$name.get()" if $codeGenerator->IsTypedArrayType($argType) and $argType ne "ArrayBuffer";
}
+
+ push(@arguments, $value);
$argsIndex++;
}
@@ -4111,26 +4103,17 @@
my $arrayOrSequenceType = $arrayType || $sequenceType;
return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType;
+ return "String" if $codeGenerator->IsEnumType($type);
- if ($codeGenerator->IsEnumType($type)) {
- return "String";
- }
-
# For all other types, the native type is a pointer with same type name as the IDL type.
return "${type}*";
}
-sub IsPointerParameterPassedByReference
+sub ShouldPassWrapperByReference
{
my $parameter = shift;
my $interface = shift;
-
- return 0 if $parameter->isVariadic;
- return 0 if $parameter->isNullable;
- return 0 if $interface->extendedAttributes->{"UsePointersEvenForNonNullableObjectArguments"};
- return 0 if $codeGenerator->IsCallbackInterface($parameter->type);
- return 0 if $parameter->isOptional and $parameter->extendedAttributes->{"Default"} and $parameter->extendedAttributes->{"Default"} eq "Undefined";
- return substr(GetNativeType($parameter->type), -1) eq '*';
+ return $codeGenerator->ShouldPassWrapperByReference($parameter, $interface) && substr(GetNativeType($parameter->type), -1) eq '*';
}
sub GetNativeVectorInnerType
@@ -5010,7 +4993,7 @@
my $index = 0;
foreach my $parameter (@{$function->parameters}) {
last if $index eq $paramIndex;
- if (IsPointerParameterPassedByReference($parameter, $interface)) {
+ if (ShouldPassWrapperByReference($parameter, $interface)) {
push(@constructorArgList, "*" . $parameter->name);
} else {
push(@constructorArgList, $parameter->name);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -542,7 +542,6 @@
return 1 if $function->signature->type eq "Promise";
return 1 if $function->signature->type eq "Symbol";
- return 1 if $function->signature->extendedAttributes->{"CustomBinding"};
foreach my $param (@{$function->parameters}) {
return 1 if $codeGenerator->GetSequenceType($param->type);
@@ -1461,6 +1460,8 @@
my $parameterIndex = 0;
my $functionSig = "- ($returnType)$functionName";
+ my @functionContent = ();
+
foreach my $param (@{$function->parameters}) {
my $paramName = $param->name;
my $paramType = GetObjCType($param->type);
@@ -1478,6 +1479,12 @@
$implGetter = GetObjCTypeGetter($paramName, $idlType);
}
+ if ($codeGenerator->ShouldPassWrapperByReference($param, $interface)) {
+ $implGetter = "*$implGetter";
+ push(@functionContent, " if (!$paramName)\n");
+ push(@functionContent, " WebCore::raiseTypeErrorException();\n");
+ }
+
push(@parameterNames, $implGetter);
$needsCustom{"XPathNSResolver"} = $paramName if $idlType eq "XPathNSResolver";
$needsCustom{"NodeFilter"} = $paramName if $idlType eq "NodeFilter";
@@ -1498,7 +1505,6 @@
$parameterIndex++;
}
- my @functionContent = ();
my $caller = "IMPL";
# special case the XPathNSResolver
Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt 2016-04-09 03:46:25 UTC (rev 199265)
@@ -19,8 +19,8 @@
#
ActiveDOMObject
+AppleCopyright
AtomicString
-CPPPureInterface
CachedAttribute
CallbackNeedsOperatorEqual
Callback=FunctionOnly
@@ -35,7 +35,6 @@
ConstructorRaisesException
ConstructorTemplate=Event|TypedArray
Custom
-CustomBinding
CustomCall
CustomConstructor
CustomDeleteProperty
@@ -51,7 +50,6 @@
CustomReturn
CustomSetter
CustomToJSObject
-UsePointersEvenForNonNullableObjectArguments
Default=NullString|Undefined
Deletable
DoNotCheckConstants
@@ -127,7 +125,5 @@
TypedArray=*
URL
Unforgeable
+UsePointersEvenForNonNullableObjectArguments
WindowEventHandler
-
-# PLATFORM(IOS)
-AppleCopyright
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -206,10 +206,8 @@
Node* nextChild = JSNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!nextChild) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!nextChild)
+ return throwVMTypeError(state);
impl.excitingFunction(*nextChild);
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -801,10 +801,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, strArg, *objArg, ec)));
setDOMException(state, ec);
@@ -871,10 +869,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, strArg, *objArg, ec)));
setDOMException(state, ec);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -161,7 +161,7 @@
if (!state->argument(0).isFunction())
return throwArgumentMustBeFunctionError(*state, 0, "listener", "TestMediaQueryListListener", "method");
RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
- impl.method(listener);
+ impl.method(WTFMove(listener));
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -508,7 +508,7 @@
if (!state->argument(1).isFunction())
return throwArgumentMustBeFunctionError(*state, 1, "testCallbackFunction", "TestObj", nullptr);
RefPtr<TestCallbackFunction> testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
- RefPtr<TestObj> object = TestObj::create(testCallback, testCallbackFunction);
+ RefPtr<TestObj> object = TestObj::create(*testCallback, *testCallbackFunction);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
}
@@ -661,8 +661,6 @@
{ "methodWithExceptionWithMessage", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithExceptionWithMessage), (intptr_t) (0) } },
{ "customMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t) (0) } },
{ "customMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t) (3) } },
- { "customBindingMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomBindingMethod), (intptr_t) (0) } },
- { "customBindingMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomBindingMethodWithArgs), (intptr_t) (3) } },
#if ENABLE(Condition3)
{ "jsBuiltinMethod", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testObjJsBuiltinMethodCodeGenerator), (intptr_t) (0) } },
#else
@@ -3316,10 +3314,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
impl.voidMethodWithArgs(longArg, strArg, *objArg);
return JSValue::encode(jsUndefined());
}
@@ -3355,10 +3351,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, *objArg));
return JSValue::encode(result);
}
@@ -3394,10 +3388,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, *objArg));
return JSValue::encode(result);
}
@@ -3433,10 +3425,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, *objArg));
return JSValue::encode(result);
}
@@ -3472,10 +3462,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, *objArg)));
return JSValue::encode(result);
}
@@ -3645,10 +3633,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, *objArg, ec)));
setDOMException(state, ec);
@@ -4134,7 +4120,7 @@
if (!state->argument(0).isObject())
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackArg");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
- impl.methodWithCallbackArg(callback);
+ impl.methodWithCallbackArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4154,7 +4140,7 @@
if (!state->argument(1).isObject())
return throwArgumentMustBeFunctionError(*state, 1, "callback", "TestObj", "methodWithNonCallbackArgAndCallbackArg");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
- impl.methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
+ impl.methodWithNonCallbackArgAndCallbackArg(nonCallback, WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4172,7 +4158,7 @@
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackAndOptionalArg");
callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
}
- impl.methodWithCallbackAndOptionalArg(callback);
+ impl.methodWithCallbackAndOptionalArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4189,7 +4175,7 @@
if (!state->argument(0).isFunction())
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackFunctionArg");
RefPtr<TestCallbackFunction> callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
- impl.methodWithCallbackFunctionArg(callback);
+ impl.methodWithCallbackFunctionArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4209,7 +4195,7 @@
if (!state->argument(1).isFunction())
return throwArgumentMustBeFunctionError(*state, 1, "callback", "TestObj", "methodWithNonCallbackArgAndCallbackFunctionArg");
RefPtr<TestCallbackFunction> callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
- impl.methodWithNonCallbackArgAndCallbackFunctionArg(nonCallback, callback);
+ impl.methodWithNonCallbackArgAndCallbackFunctionArg(nonCallback, WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4227,7 +4213,7 @@
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackFunctionAndOptionalArg");
callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
}
- impl.methodWithCallbackFunctionAndOptionalArg(callback);
+ impl.methodWithCallbackFunctionAndOptionalArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4239,7 +4225,7 @@
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "staticMethodWithCallbackAndOptionalArg");
callback = createFunctionOnlyCallback<JSTestCallback>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
}
- TestObj::staticMethodWithCallbackAndOptionalArg(callback);
+ TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4250,7 +4236,7 @@
if (!state->argument(0).isObject())
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "staticMethodWithCallbackArg");
RefPtr<TestCallback> callback = createFunctionOnlyCallback<JSTestCallback>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
- TestObj::staticMethodWithCallbackArg(callback);
+ TestObj::staticMethodWithCallbackArg(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4393,7 +4379,7 @@
if (!state->argument(0).isObject())
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "overloadedMethod");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
- impl.overloadedMethod(callback);
+ impl.overloadedMethod(WTFMove(callback));
return JSValue::encode(jsUndefined());
}
@@ -4444,10 +4430,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
impl.overloadedMethod(*objArg);
return JSValue::encode(jsUndefined());
}
@@ -4856,10 +4840,8 @@
TestNode* value = JSTestNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!value) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!value)
+ return throwVMTypeError(state);
impl.convert1(*value);
return JSValue::encode(jsUndefined());
}
@@ -4993,10 +4975,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
Vector<unsigned> a = toNativeArray<unsigned>(state, state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
@@ -5022,10 +5002,8 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!objArg)
+ return throwVMTypeError(state);
Vector<int> array = toNativeArray<int>(state, state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
@@ -5088,10 +5066,8 @@
Node* head = JSNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!head) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!head)
+ return throwVMTypeError(state);
Vector<Node*> tail;
for (unsigned i = 1, count = state->argumentCount(); i < count; ++i) {
if (!state->uncheckedArgument(i).inherits(JSNode::info()))
@@ -5159,10 +5135,8 @@
float a = state->argument(0).toFloat(state);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!std::isfinite(a)) {
- setDOMException(state, TypeError);
- return JSValue::encode(jsUndefined());
- }
+ if (!std::isfinite(a))
+ return throwVMTypeError(state);
impl.testPromiseFunctionWithFloatArgument(a, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
}
@@ -5234,10 +5208,8 @@
float a = state->argument(0).toFloat(state);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!std::isfinite(a)) {
- setDOMException(state, TypeError);
- return JSValue::encode(jsUndefined());
- }
+ if (!std::isfinite(a))
+ return throwVMTypeError(state);
impl.testPromiseOverloadedFunction(a, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
}
@@ -5261,10 +5233,8 @@
FetchRequest* request = JSFetchRequest::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!request) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!request)
+ return throwVMTypeError(state);
impl.testPromiseOverloadedFunction(*request, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h 2016-04-09 03:46:25 UTC (rev 199265)
@@ -102,12 +102,7 @@
inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestObj& impl) { return toJS(state, globalObject, &impl); }
JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
-// Functions
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomBindingMethod(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomBindingMethodWithArgs(JSC::ExecState*);
-
-
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -73,10 +73,8 @@
ArrayBuffer* arrayBuffer = toArrayBuffer(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!arrayBuffer) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!arrayBuffer)
+ return throwVMTypeError(state);
RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*arrayBuffer);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
}
@@ -101,10 +99,8 @@
Blob* blob = JSBlob::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!blob) {
- setDOMException(state, TYPE_MISMATCH_ERR);
- return JSValue::encode(jsUndefined());
- }
+ if (!blob)
+ return throwVMTypeError(state);
RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*blob);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-04-09 03:46:25 UTC (rev 199265)
@@ -134,7 +134,7 @@
if (!state->argument(1).isObject())
return throwArgumentMustBeFunctionError(*state, 1, "testCallback", "TestTypedefs", nullptr);
RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
- RefPtr<TestTypedefs> object = TestTypedefs::create(hello, testCallback);
+ RefPtr<TestTypedefs> object = TestTypedefs::create(hello, *testCallback);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -64,7 +64,9 @@
- (void)excitingFunction:(DOMNode *)nextChild
{
WebCore::JSMainThreadNullState state;
- IMPL->excitingFunction(core(nextChild));
+ if (!nextChild)
+ WebCore::raiseTypeErrorException();
+ IMPL->excitingFunction(*core(nextChild));
}
- (void)postMessage:(NSString *)message
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -76,7 +76,9 @@
- (BOOL)callbackWithArrayParam:(DOMFloat32Array *)arrayParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackWithArrayParam(core(arrayParam));
+ if (!arrayParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackWithArrayParam(*core(arrayParam));
}
- (BOOL)callbackWithSerializedScriptValueParam:(NSString *)srzParam strArg:(NSString *)strArg
@@ -94,13 +96,19 @@
- (int)customCallback:(DOMClass5 *)class5Param class6Param:(DOMClass6 *)class6Param
{
WebCore::JSMainThreadNullState state;
- return IMPL->customCallback(core(class5Param), core(class6Param));
+ if (!class5Param)
+ WebCore::raiseTypeErrorException();
+ if (!class6Param)
+ WebCore::raiseTypeErrorException();
+ return IMPL->customCallback(*core(class5Param), *core(class6Param));
}
- (BOOL)callbackWithStringList:(DOMDOMStringList *)listParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackWithStringList(core(listParam));
+ if (!listParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackWithStringList(*core(listParam));
}
- (BOOL)callbackWithBoolean:(BOOL)boolParam
@@ -112,7 +120,9 @@
- (BOOL)callbackRequiresThisToPass:(int)longParam testNodeParam:(DOMTestNode *)testNodeParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackRequiresThisToPass(longParam, core(testNodeParam));
+ if (!testNodeParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackRequiresThisToPass(longParam, *core(testNodeParam));
}
@end
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -76,7 +76,9 @@
- (BOOL)callbackWithArrayParam:(DOMFloat32Array *)arrayParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackWithArrayParam(core(arrayParam));
+ if (!arrayParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackWithArrayParam(*core(arrayParam));
}
- (BOOL)callbackWithSerializedScriptValueParam:(NSString *)srzParam strArg:(NSString *)strArg
@@ -94,13 +96,19 @@
- (int)customCallback:(DOMClass5 *)class5Param class6Param:(DOMClass6 *)class6Param
{
WebCore::JSMainThreadNullState state;
- return IMPL->customCallback(core(class5Param), core(class6Param));
+ if (!class5Param)
+ WebCore::raiseTypeErrorException();
+ if (!class6Param)
+ WebCore::raiseTypeErrorException();
+ return IMPL->customCallback(*core(class5Param), *core(class6Param));
}
- (BOOL)callbackWithStringList:(DOMDOMStringList *)listParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackWithStringList(core(listParam));
+ if (!listParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackWithStringList(*core(listParam));
}
- (BOOL)callbackWithBoolean:(BOOL)boolParam
@@ -112,7 +120,9 @@
- (BOOL)callbackRequiresThisToPass:(int)longParam testNodeParam:(DOMTestNode *)testNodeParam
{
WebCore::JSMainThreadNullState state;
- return IMPL->callbackRequiresThisToPass(longParam, core(testNodeParam));
+ if (!testNodeParam)
+ WebCore::raiseTypeErrorException();
+ return IMPL->callbackRequiresThisToPass(longParam, *core(testNodeParam));
}
@end
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -194,8 +194,10 @@
- (DOMTestObj *)implementsMethod2:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
WebCore::ExceptionCode ec = 0;
- DOMTestObj *result = kit(WTF::getPtr(IMPL->implementsMethod2(strArg, core(objArg), ec)));
+ DOMTestObj *result = kit(WTF::getPtr(IMPL->implementsMethod2(strArg, *core(objArg), ec)));
WebCore::raiseOnDOMError(ec);
return result;
}
@@ -237,8 +239,10 @@
- (DOMTestObj *)supplementalMethod2:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
WebCore::ExceptionCode ec = 0;
- DOMTestObj *result = kit(WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(*IMPL, strArg, core(objArg), ec)));
+ DOMTestObj *result = kit(WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(*IMPL, strArg, *core(objArg), ec)));
WebCore::raiseOnDOMError(ec);
return result;
}
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -58,7 +58,9 @@
- (void)method:(DOMMediaQueryListListener *)listener
{
WebCore::JSMainThreadNullState state;
- IMPL->method(core(listener));
+ if (!listener)
+ WebCore::raiseTypeErrorException();
+ IMPL->method(*core(listener));
}
@end
Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm 2016-04-09 03:46:25 UTC (rev 199265)
@@ -970,7 +970,9 @@
- (void)voidMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- IMPL->voidMethodWithArgs(longArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ IMPL->voidMethodWithArgs(longArg, strArg, *core(objArg));
}
- (char)byteMethod
@@ -982,7 +984,9 @@
- (char)byteMethodWithArgs:(char)byteArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- return IMPL->byteMethodWithArgs(byteArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ return IMPL->byteMethodWithArgs(byteArg, strArg, *core(objArg));
}
- (unsigned char)octetMethod
@@ -994,7 +998,9 @@
- (unsigned char)octetMethodWithArgs:(unsigned char)octetArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- return IMPL->octetMethodWithArgs(octetArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ return IMPL->octetMethodWithArgs(octetArg, strArg, *core(objArg));
}
- (int)longMethod
@@ -1006,7 +1012,9 @@
- (int)longMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- return IMPL->longMethodWithArgs(longArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ return IMPL->longMethodWithArgs(longArg, strArg, *core(objArg));
}
- (DOMTestObj *)objMethod
@@ -1018,7 +1026,9 @@
- (DOMTestObj *)objMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- return kit(WTF::getPtr(IMPL->objMethodWithArgs(longArg, strArg, core(objArg))));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ return kit(WTF::getPtr(IMPL->objMethodWithArgs(longArg, strArg, *core(objArg))));
}
- (int)unforgeableMethod
@@ -1066,8 +1076,10 @@
- (DOMTestObj *)methodThatRequiresAllArgsAndThrows:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
WebCore::ExceptionCode ec = 0;
- DOMTestObj *result = kit(WTF::getPtr(IMPL->methodThatRequiresAllArgsAndThrows(strArg, core(objArg), ec)));
+ DOMTestObj *result = kit(WTF::getPtr(IMPL->methodThatRequiresAllArgsAndThrows(strArg, *core(objArg), ec)));
WebCore::raiseOnDOMError(ec);
return result;
}
@@ -1107,7 +1119,9 @@
- (void)customMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- IMPL->customMethodWithArgs(longArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ IMPL->customMethodWithArgs(longArg, strArg, *core(objArg));
}
@@ -1125,7 +1139,9 @@
- (void)jsBuiltinMethodWithArgs:(int)longArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg
{
WebCore::JSMainThreadNullState state;
- IMPL->jsBuiltinMethodWithArgs(longArg, strArg, core(objArg));
+ if (!objArg)
+ WebCore::raiseTypeErrorException();
+ IMPL->jsBuiltinMethodWithArgs(longArg, strArg, *core(objArg));
}
#endif
@@ -1133,15 +1149,19 @@
- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
{
WebCore::JSMainThreadNullState state;
+ if (!listener)
+ WebCore::raiseTypeErrorException();
RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
- IMPL->addEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+ IMPL->addEventListener(type, *WTF::getPtr(nativeEventListener), useCapture);
}
- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
{
WebCore::JSMainThreadNullState state;
+ if (!listener)
+ WebCore::raiseTypeErrorException();
RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
- IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+ IMPL->removeEventListener(type, *WTF::getPtr(nativeEventListener), useCapture);
}
- (void)withScriptStateVoid
@@ -1340,7 +1360,9 @@
- (void)convert1:(DOMTestNode *)value
{
WebCore::JSMainThreadNullState state;
- IMPL->convert1(core(value));
+ if (!value)
+ WebCore::raiseTypeErrorException();
+ IMPL->convert1(*core(value));
}
- (void)convert2:(DOMTestNode *)value
@@ -1403,7 +1425,9 @@
- (void)variadicNodeMethod:(DOMNode *)head tail:(DOMNode *)tail
{
WebCore::JSMainThreadNullState state;
- IMPL->variadicNodeMethod(core(head), core(tail));
+ if (!head)
+ WebCore::raiseTypeErrorException();
+ IMPL->variadicNodeMethod(*core(head), core(tail));
}
- (void)any:(float)a b:(int)b
Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (199264 => 199265)
--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl 2016-04-09 03:46:25 UTC (rev 199265)
@@ -137,10 +137,6 @@
[Custom] void customMethod();
[Custom] void customMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
- // 'CustomBinding' extended attribute
- [CustomBinding] void customBindingMethod();
- [CustomBinding] void customBindingMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
-
// 'JSBuiltin' extended attribute
[Conditional=Condition3, JSBuiltin] void jsBuiltinMethod();
[Conditional=Condition3, JSBuiltin] void jsBuiltinMethodWithArgs(long longArg, DOMString strArg, TestObj objArg);
Modified: trunk/Source/WebCore/dom/DOMImplementation.idl (199264 => 199265)
--- trunk/Source/WebCore/dom/DOMImplementation.idl 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/dom/DOMImplementation.idl 2016-04-09 03:46:25 UTC (rev 199265)
@@ -30,24 +30,22 @@
// DOM Level 2
- [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([Default=Undefined] optional DOMString? qualifiedName,
- [Default=Undefined] optional DOMString? publicId, [Default=Undefined] optional DOMString? systemId);
+ [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([Default=Undefined] optional DOMString? qualifiedName, [Default=Undefined] optional DOMString? publicId, [Default=Undefined] optional DOMString? systemId);
+ [NewObject, ObjCLegacyUnnamedParameters, RaisesException]
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
- [ObjCLegacyUnnamedParameters, RaisesException] Document createDocument(optional DOMString namespaceURI, optional DOMString qualifiedName,
- optional DocumentType doctype);
+ Document
#else
- [RaisesException, NewObject] XMLDocument createDocument([Default=Undefined] optional DOMString? namespaceURI,
- [TreatNullAs=EmptyString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
+ XMLDocument
#endif
+ createDocument([Default=Undefined] optional DOMString? namespaceURI, [TreatNullAs=EmptyString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
// DOMImplementationCSS interface from DOM Level 2 CSS
- [ObjCLegacyUnnamedParameters, RaisesException] CSSStyleSheet createCSSStyleSheet([Default=Undefined] optional DOMString title,
- [Default=Undefined] optional DOMString media);
+ [ObjCLegacyUnnamedParameters, RaisesException] CSSStyleSheet createCSSStyleSheet([Default=Undefined] optional DOMString title, [Default=Undefined] optional DOMString media);
// HTMLDOMImplementation interface from DOM Level 2 HTML
[NewObject] HTMLDocument createHTMLDocument([Default=NullString] optional DOMString title);
-};
+};
Modified: trunk/Source/WebCore/dom/EventListener.idl (199264 => 199265)
--- trunk/Source/WebCore/dom/EventListener.idl 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/dom/EventListener.idl 2016-04-09 03:46:25 UTC (rev 199265)
@@ -22,7 +22,6 @@
[
NoInterfaceObject,
ObjCProtocol,
- CPPPureInterface,
] interface EventListener {
void handleEvent(Event event);
};
Modified: trunk/Source/WebCore/dom/EventTarget.idl (199264 => 199265)
--- trunk/Source/WebCore/dom/EventTarget.idl 2016-04-09 03:07:43 UTC (rev 199264)
+++ trunk/Source/WebCore/dom/EventTarget.idl 2016-04-09 03:46:25 UTC (rev 199265)
@@ -20,7 +20,6 @@
// Introduced in DOM Level 2:
[
- CPPPureInterface,
CustomToJSObject,
UsePointersEvenForNonNullableObjectArguments,
JSCustomToNativeObject,