+2013-09-13 Eric Carlson <eric.carlson@apple.com>
+
+ CodeGeneratorJS doesn't generate header includes for sequence<type>
+ https://bugs.webkit.org/show_bug.cgi?id=121314
+
+ Reviewed by Dean Jackson.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (SkipIncludeHeader): Don't return false for sequence and array types.
+ (AddIncludesForType): Do add includes for sequence and array types.
+ (GenerateCallbackImplementation):
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp: Regenerated
+ * bindings/scripts/test/JS/JSTestTypedefs.h: Ditto.
+ * bindings/scripts/test/TestTypedefs.idl: Add a method that takes a sequence<TestEventTarget>.
+
2013-09-13 Andreas Kling <akling@apple.com>
CTTE: RenderSVGResourcePattern always has an SVGPatternElement.
my $type = shift;
return 1 if $codeGenerator->SkipIncludeHeader($type);
- return 1 if $codeGenerator->GetSequenceType($type) or $codeGenerator->GetArrayType($type);
return $typesWithoutHeader{$type};
}
$includesRef->{"JSCustomXPathNSResolver.h"} = 1;
} elsif ($isCallback && $codeGenerator->IsWrapperType($type)) {
$includesRef->{"JS${type}.h"} = 1;
+ } elsif ($codeGenerator->GetSequenceType($type) or $codeGenerator->GetArrayType($type)) {
+ my $arrayType = $codeGenerator->GetArrayType($type);
+ my $sequenceType = $codeGenerator->GetSequenceType($type);
+ my $arrayOrSequenceType = $arrayType || $sequenceType;
+
+ if ($arrayType eq "DOMString") {
+ $includesRef->{"JSDOMStringList.h"} = 1;
+ $includesRef->{"DOMStringList.h"} = 1;
+ } elsif ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) {
+ $includesRef->{"JS${arrayOrSequenceType}.h"} = 1;
+ $includesRef->{"${arrayOrSequenceType}.h"} = 1;
+ }
+ $includesRef->{"<runtime/JSArray.h>"} = 1;
} else {
# default, include the same named file
$includesRef->{"${type}.h"} = 1;
#include "JSSVGPoint.h"
#include "JSSerializedScriptValue.h"
#include "JSTestCallback.h"
+#include "JSTestEventTarget.h"
#include "JSTestSubObj.h"
#include "KURL.h"
#include "SVGPoint.h"
{ "immutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionImmutablePointFunction), (intptr_t)0, NoIntrinsic },
{ "stringArrayFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringArrayFunction), (intptr_t)1, NoIntrinsic },
{ "stringArrayFunction2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionStringArrayFunction2), (intptr_t)1, NoIntrinsic },
+ { "callWithSequenceThatRequiresInclude", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude), (intptr_t)1, NoIntrinsic },
{ "methodWithException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestTypedefsPrototypeFunctionMethodWithException), (intptr_t)0, NoIntrinsic },
{ 0, 0, 0, 0, NoIntrinsic }
};
return JSValue::encode(result);
}
+EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(JSTestTypedefs::info()))
+ return throwVMTypeError(exec);
+ JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
+ TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createNotEnoughArgumentsError(exec));
+ Vector<RefPtr<TestEventTarget> > sequenceArg((toRefPtrNativeArray<TestEventTarget, JSTestEventTarget>(exec, exec->argument(0), &toTestEventTarget)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = jsBoolean(impl->callWithSequenceThatRequiresInclude(sequenceArg));
+ return JSValue::encode(result);
+}
+
EncodedJSValue JSC_HOST_CALL jsTestTypedefsPrototypeFunctionMethodWithException(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();