+2015-04-30 Oliver Hunt <oliver@apple.com>
+
+ DOM bindings should not be using a reference type to point to a temporary object
+ https://bugs.webkit.org/show_bug.cgi?id=144474
+
+ Reviewed by Beth Dakin.
+
+ The DOM bindings will currently try and use a local reference to point
+ to a temporary object. This currently works as a by product of the compiler's
+ stack layout. This patch removes the dependency on undefined behaviour
+ by ensuring that we use a value rather than reference type.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateParametersCheck):
+ (GetNativeTypeForCallbacks):
+
2015-04-30 Brady Eidson <beidson@apple.com>
Javascript using WebSQL can create their own WebKit info table.
push(@$outputArray, " AtomicStringImpl* existing_$name = exec->argument($argsIndex).isEmpty() ? nullptr : exec->argument($argsIndex).toString(exec)->toExistingAtomicString(exec);\n");
push(@$outputArray, " if (!existing_$name)\n");
push(@$outputArray, " return JSValue::encode(jsNull());\n");
- push(@$outputArray, " const AtomicString& $name(existing_$name);\n");
+ push(@$outputArray, " const AtomicString $name(existing_$name);\n");
} else {
push(@$outputArray, " " . GetNativeTypeFromSignature($parameter) . " $name(" . JSValueToNative($parameter, $optional && $defaultAttribute && $defaultAttribute eq "NullString" ? "argumentOrNull(exec, $argsIndex)" : "exec->argument($argsIndex)", $function->signature->extendedAttributes->{"Conditional"}) . ");\n");
}
my %nativeType = (
"CompareHow" => "Range::CompareHow",
- "DOMString" => "const String&",
+ "DOMString" => "const String",
"NodeFilter" => "RefPtr<NodeFilter>",
"SerializedScriptValue" => "RefPtr<SerializedScriptValue>",
"Date" => "double",
my $type = shift;
return "PassRefPtr<SerializedScriptValue>" if $type eq "SerializedScriptValue";
return "PassRefPtr<DOMStringList>" if $type eq "DOMStringList";
+ return "const String&" if $type eq "DOMString";
return GetNativeType($type);
}