Make dartj2s do type conversions on constructor arguments

BUG=
R=terry@google.com

Review URL: https://codereview.chromium.org//1023363002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44688 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
alanknight@google.com 2015-03-25 17:39:49 +00:00
parent 18758d3d22
commit 5397482fcc
10 changed files with 163 additions and 108 deletions

View file

@ -275,7 +275,8 @@ class Animation extends AnimationNode {
return Animation._create_2(target, keyframes, timingInput);
}
if ((timingInput is Map || timingInput == null) && (keyframes is List<Map> || keyframes == null) && (target is Element || target == null)) {
return Animation._create_3(target, keyframes, timingInput);
var timingInput_1 = convertDartToNative_Dictionary(timingInput);
return Animation._create_3(target, keyframes, timingInput_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -2036,8 +2037,8 @@ class CanvasRenderingContext2D extends Interceptor implements CanvasRenderingCon
return;
}
if (dirtyHeight != null && dirtyWidth != null && dirtyY != null && dirtyX != null) {
var imagedata_2 = convertDartToNative_ImageData(imagedata);
_putImageData_2(imagedata_2, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
var imagedata_1 = convertDartToNative_ImageData(imagedata);
_putImageData_2(imagedata_1, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
@ -2524,7 +2525,8 @@ class CircularGeofencingRegion extends GeofencingRegion {
@DomName('CircularGeofencingRegion.CircularGeofencingRegion')
@DocsEditable()
factory CircularGeofencingRegion(Map init) {
return CircularGeofencingRegion._create_1(init);
var init_1 = convertDartToNative_Dictionary(init);
return CircularGeofencingRegion._create_1(init_1);
}
static CircularGeofencingRegion _create_1(init) => JS('CircularGeofencingRegion', 'new CircularGeofencingRegion(#)', init);
@ -7329,13 +7331,13 @@ class DirectoryEntry extends Entry {
return;
}
if (successCallback != null) {
var options_2 = convertDartToNative_Dictionary(options);
__getDirectory_2(path, options_2, successCallback);
var options_1 = convertDartToNative_Dictionary(options);
__getDirectory_2(path, options_1, successCallback);
return;
}
if (options != null) {
var options_3 = convertDartToNative_Dictionary(options);
__getDirectory_3(path, options_3);
var options_1 = convertDartToNative_Dictionary(options);
__getDirectory_3(path, options_1);
return;
}
__getDirectory_4(path);
@ -7378,13 +7380,13 @@ class DirectoryEntry extends Entry {
return;
}
if (successCallback != null) {
var options_2 = convertDartToNative_Dictionary(options);
__getFile_2(path, options_2, successCallback);
var options_1 = convertDartToNative_Dictionary(options);
__getFile_2(path, options_1, successCallback);
return;
}
if (options != null) {
var options_3 = convertDartToNative_Dictionary(options);
__getFile_3(path, options_3);
var options_1 = convertDartToNative_Dictionary(options);
__getFile_3(path, options_1);
return;
}
__getFile_4(path);
@ -9099,7 +9101,8 @@ class DomPoint extends DomPointReadOnly {
return DomPoint._create_1();
}
if ((point_OR_x is Map || point_OR_x == null) && y == null && z == null && w == null) {
return DomPoint._create_2(point_OR_x);
var point_1 = convertDartToNative_Dictionary(point_OR_x);
return DomPoint._create_2(point_1);
}
if ((y is num || y == null) && (point_OR_x is num || point_OR_x == null) && z == null && w == null) {
return DomPoint._create_3(point_OR_x, y);
@ -13940,7 +13943,8 @@ class EventSource extends EventTarget {
@DocsEditable()
static EventSource _factoryEventSource(String url, [Map eventSourceInit]) {
if (eventSourceInit != null) {
return EventSource._create_1(url, eventSourceInit);
var eventSourceInit_1 = convertDartToNative_Dictionary(eventSourceInit);
return EventSource._create_1(url, eventSourceInit_1);
}
return EventSource._create_2(url);
}
@ -14906,19 +14910,22 @@ class FontFace extends Interceptor {
return FontFace._create_1(family, source);
}
if ((descriptors is Map || descriptors == null) && (source is String || source == null) && (family is String || family == null)) {
return FontFace._create_2(family, source, descriptors);
var descriptors_1 = convertDartToNative_Dictionary(descriptors);
return FontFace._create_2(family, source, descriptors_1);
}
if ((source is TypedData || source == null) && (family is String || family == null) && descriptors == null) {
return FontFace._create_3(family, source);
}
if ((descriptors is Map || descriptors == null) && (source is TypedData || source == null) && (family is String || family == null)) {
return FontFace._create_4(family, source, descriptors);
var descriptors_1 = convertDartToNative_Dictionary(descriptors);
return FontFace._create_4(family, source, descriptors_1);
}
if ((source is ByteBuffer || source == null) && (family is String || family == null) && descriptors == null) {
return FontFace._create_5(family, source);
}
if ((descriptors is Map || descriptors == null) && (source is ByteBuffer || source == null) && (family is String || family == null)) {
return FontFace._create_6(family, source, descriptors);
var descriptors_1 = convertDartToNative_Dictionary(descriptors);
return FontFace._create_6(family, source, descriptors_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -16153,7 +16160,8 @@ class Headers extends Interceptor {
return Headers._create_2(input);
}
if ((input is Map || input == null)) {
return Headers._create_3(input);
var input_1 = convertDartToNative_Dictionary(input);
return Headers._create_3(input_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -20637,8 +20645,8 @@ class MessagePort extends EventTarget {
_postMessage_1(message_1, transfer);
return;
}
var message_2 = convertDartToNative_SerializedScriptValue(message);
_postMessage_2(message_2);
var message_1 = convertDartToNative_SerializedScriptValue(message);
_postMessage_2(message_1);
return;
}
@JSName('postMessage')
@ -22745,9 +22753,7 @@ class Notification extends EventTarget {
if (lang != null) parsedOptions['lang'] = lang;
if (tag != null) parsedOptions['tag'] = tag;
if (icon != null) parsedOptions['icon'] = icon;
var nativeOptions;
nativeOptions = convertDartToNative_Dictionary(parsedOptions);
return Notification._factoryNotification(title, nativeOptions);
return Notification._factoryNotification(title, parsedOptions);
}
// To suppress missing implicit constructor warnings.
factory Notification._() { throw new UnsupportedError("Not supported"); }
@ -22796,7 +22802,8 @@ class Notification extends EventTarget {
@DocsEditable()
static Notification _factoryNotification(String title, [Map options]) {
if (options != null) {
return Notification._create_1(title, options);
var options_1 = convertDartToNative_Dictionary(options);
return Notification._create_1(title, options_1);
}
return Notification._create_2(title);
}
@ -25154,8 +25161,8 @@ class RtcPeerConnection extends EventTarget {
return;
}
if (configuration != null) {
var configuration_3 = convertDartToNative_Dictionary(configuration);
_updateIce_2(configuration_3);
var configuration_1 = convertDartToNative_Dictionary(configuration);
_updateIce_2(configuration_1);
return;
}
_updateIce_3();
@ -25942,8 +25949,8 @@ class ServiceWorkerGlobalScope extends WorkerGlobalScope {
return _fetch_3(request);
}
if (requestInitDict != null && (request is _Request || request == null)) {
var requestInitDict_2 = convertDartToNative_Dictionary(requestInitDict);
return _fetch_4(request, requestInitDict_2);
var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
return _fetch_4(request, requestInitDict_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -29924,7 +29931,8 @@ class WebSocket extends EventTarget {
return WebSocket._create_2(url, protocol_OR_protocols);
}
if ((protocol_OR_protocols is List<String> || protocol_OR_protocols == null) && (url is String || url == null)) {
return WebSocket._create_3(url, protocol_OR_protocols);
List protocols_1 = convertDartToNative_StringArray(protocol_OR_protocols);
return WebSocket._create_3(url, protocols_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -31408,8 +31416,8 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
_postMessage_1(message_1, targetOrigin, transfer);
return;
}
var message_2 = convertDartToNative_SerializedScriptValue(message);
_postMessage_2(message_2, targetOrigin);
var message_1 = convertDartToNative_SerializedScriptValue(message);
_postMessage_2(message_1, targetOrigin);
return;
}
@JSName('postMessage')
@ -31484,8 +31492,8 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
return;
}
if (scrollOptions != null && (y is int) && (x is int)) {
var scrollOptions_2 = convertDartToNative_Dictionary(scrollOptions);
_scroll_4(x, y, scrollOptions_2);
var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
_scroll_4(x, y, scrollOptions_1);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
@ -31572,8 +31580,8 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
return;
}
if (scrollOptions != null && (y is int) && (x is int)) {
var scrollOptions_2 = convertDartToNative_Dictionary(scrollOptions);
_scrollBy_4(x, y, scrollOptions_2);
var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
_scrollBy_4(x, y, scrollOptions_1);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
@ -31654,8 +31662,8 @@ class Window extends EventTarget implements WindowEventHandlers, WindowBase, Glo
return;
}
if (scrollOptions != null && (y is int) && (x is int)) {
var scrollOptions_2 = convertDartToNative_Dictionary(scrollOptions);
_scrollTo_4(x, y, scrollOptions_2);
var scrollOptions_1 = convertDartToNative_Dictionary(scrollOptions);
_scrollTo_4(x, y, scrollOptions_1);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
@ -34020,13 +34028,15 @@ class _Request extends Body {
return _Request._create_1(input);
}
if ((requestInitDict is Map || requestInitDict == null) && (input is String || input == null)) {
return _Request._create_2(input, requestInitDict);
var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
return _Request._create_2(input, requestInitDict_1);
}
if ((input is _Request || input == null) && requestInitDict == null) {
return _Request._create_3(input);
}
if ((requestInitDict is Map || requestInitDict == null) && (input is _Request || input == null)) {
return _Request._create_4(input, requestInitDict);
var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
return _Request._create_4(input, requestInitDict_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -34085,25 +34095,29 @@ abstract class _Response extends Body {
return _Response._create_1(body_OR_input);
}
if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is String || body_OR_input == null)) {
return _Response._create_2(body_OR_input, requestInitDict_OR_responseInitDict);
var responseInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
return _Response._create_2(body_OR_input, responseInitDict_1);
}
if ((body_OR_input is Blob || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
return _Response._create_3(body_OR_input);
}
if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is Blob || body_OR_input == null)) {
return _Response._create_4(body_OR_input, requestInitDict_OR_responseInitDict);
var responseInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
return _Response._create_4(body_OR_input, responseInitDict_1);
}
if ((body_OR_input is TypedData || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
return _Response._create_5(body_OR_input);
}
if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is TypedData || body_OR_input == null)) {
return _Response._create_6(body_OR_input, requestInitDict_OR_responseInitDict);
var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
return _Response._create_6(body_OR_input, requestInitDict_1);
}
if ((body_OR_input is ByteBuffer || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
return _Response._create_7(body_OR_input);
}
if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is ByteBuffer || body_OR_input == null)) {
return _Response._create_8(body_OR_input, requestInitDict_OR_responseInitDict);
var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
return _Response._create_8(body_OR_input, requestInitDict_1);
}
throw new ArgumentError("Incorrect number or type of arguments");
}

View file

@ -24852,9 +24852,7 @@ class Notification extends EventTarget {
if (lang != null) parsedOptions['lang'] = lang;
if (tag != null) parsedOptions['tag'] = tag;
if (icon != null) parsedOptions['icon'] = icon;
var nativeOptions;
nativeOptions = parsedOptions;
return Notification._factoryNotification(title, nativeOptions);
return Notification._factoryNotification(title, parsedOptions);
}
// To suppress missing implicit constructor warnings.
factory Notification._() { throw new UnsupportedError("Not supported"); }

View file

@ -1042,8 +1042,8 @@ class ObjectStore extends Interceptor {
var key_2 = convertDartToNative_SerializedScriptValue(key);
return _add_1(value_1, key_2);
}
var value_3 = convertDartToNative_SerializedScriptValue(value);
return _add_2(value_3);
var value_1 = convertDartToNative_SerializedScriptValue(value);
return _add_2(value_1);
}
@JSName('add')
@DomName('IDBObjectStore.add')
@ -1081,13 +1081,13 @@ class ObjectStore extends Interceptor {
return _createIndex_2(name, keyPath, options_1);
}
if ((keyPath is List<String> || keyPath == null) && options == null) {
List keyPath_2 = convertDartToNative_StringArray(keyPath);
return _createIndex_3(name, keyPath_2);
List keyPath_1 = convertDartToNative_StringArray(keyPath);
return _createIndex_3(name, keyPath_1);
}
if (options != null && (keyPath is List<String> || keyPath == null)) {
List keyPath_3 = convertDartToNative_StringArray(keyPath);
var options_4 = convertDartToNative_Dictionary(options);
return _createIndex_4(name, keyPath_3, options_4);
List keyPath_1 = convertDartToNative_StringArray(keyPath);
var options_2 = convertDartToNative_Dictionary(options);
return _createIndex_4(name, keyPath_1, options_2);
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@ -1153,8 +1153,8 @@ class ObjectStore extends Interceptor {
var key_2 = convertDartToNative_SerializedScriptValue(key);
return _put_1(value_1, key_2);
}
var value_3 = convertDartToNative_SerializedScriptValue(value);
return _put_2(value_3);
var value_1 = convertDartToNative_SerializedScriptValue(value);
return _put_2(value_1);
}
@JSName('put')
@DomName('IDBObjectStore.put')

BIN
tests/html/Ahem.ttf Normal file

Binary file not shown.

View file

@ -0,0 +1,22 @@
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library fontface_test;
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
import 'dart:html';
main() {
useHtmlConfiguration();
test("Creation with parameters", () {
var font =
new FontFace('Ahem', 'url(Ahem.ttf)', {'variant': 'small-caps'});
expect(font is FontFace, isTrue);
expect(font.family, 'Ahem');
expect(font.variant, 'small-caps');
});
}

View file

@ -36,6 +36,7 @@ storage_quota_test: Fail # Support for promises.
[ $compiler == dart2js && ($runtime == safari || $runtime == safarimobilesim || $runtime == ff || $ie) ]
custom/entered_left_view_test/viewless_document: Fail # Polyfill does not handle this
fontface_test: Fail # Fontface not supported on these.
element_animate_test: Fail # Element.animate not supported on these browsers.
[ $compiler == none && $runtime == dartium && $system == macos]

View file

@ -542,6 +542,14 @@ class HtmlDartGenerator(object):
else:
factory_parameters = ', '.join(constructor_info.factory_parameters)
def InputType(type_name):
conversion = self._InputConversion(
type_name, constructor_info.declared_name)
if conversion:
return conversion.input_type
else:
return self._NarrowInputType(type_name) if type_name else 'dynamic'
if constructor_info.pure_dart_constructor:
# TODO(antonm): use common dispatcher generation for this case as well.
has_optional = any(param_info.is_optional
@ -553,7 +561,7 @@ class HtmlDartGenerator(object):
'factory $CTOR($PARAMS) => '
'$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n',
CTOR=constructor_info._ConstructorFullName(self._DartType),
PARAMS=constructor_info.ParametersAsDeclaration(self._DartType),
PARAMS=constructor_info.ParametersAsDeclaration(InputType),
FACTORY=factory_name,
METADATA=metadata,
CTOR_FACTORY_NAME=factory_constructor_name,
@ -570,7 +578,7 @@ class HtmlDartGenerator(object):
METADATA=metadata,
FACTORY=factory_name,
CTOR_FACTORY_NAME=factory_constructor_name,
PARAMS=constructor_info.ParametersAsDeclaration(self._DartType),
PARAMS=constructor_info.ParametersAsDeclaration(InputType),
FACTORY_PARAMS=factory_parameters)
for index, param_info in enumerate(constructor_info.param_infos):
@ -586,6 +594,7 @@ class HtmlDartGenerator(object):
version, signature_index, argument_count):
name = emitter.Format('_create_$VERSION', VERSION=version)
arguments = constructor_info.idl_args[signature_index][:argument_count]
args = None
if self._dart_use_blink:
type_ids = [p.type.id for p in arguments]
base_name, rs = \
@ -593,15 +602,18 @@ class HtmlDartGenerator(object):
qualified_name = \
self.DeriveQualifiedBlinkName(self._interface.id,
base_name)
args = constructor_info.ParametersAsArgumentList(argument_count)
else:
qualified_name = emitter.Format(
'$FACTORY.$NAME',
FACTORY=factory_name,
NAME=name)
(factory_params, converted_arguments) = self._ConvertArgumentTypes(
stmts_emitter, arguments, argument_count, constructor_info)
args = ', '.join(converted_arguments)
call_emitter.Emit('$FACTORY_NAME($FACTORY_PARAMS)',
FACTORY_NAME=qualified_name,
FACTORY_PARAMS= \
constructor_info.ParametersAsArgumentList(argument_count))
FACTORY_PARAMS=args)
self.EmitStaticFactoryOverload(constructor_info, name, arguments)
def IsOptional(signature_index, argument):
@ -614,7 +626,7 @@ class HtmlDartGenerator(object):
CTOR=(('' if not custom_factory_ctr else '_factory')
+ constructor_full_name),
METADATA=metadata,
PARAMS=constructor_info.ParametersAsDeclaration(self._DartType))
PARAMS=constructor_info.ParametersAsDeclaration(InputType))
overload_emitter = self._members_emitter
overload_declaration = entry_declaration

View file

@ -999,6 +999,53 @@ class Dart2JSBackend(HtmlDartGenerator):
NAME=html_name,
PARAMS=info.ParametersAsDeclaration(self._NarrowInputType))
def _ConvertArgumentTypes(
self, stmts_emitter, arguments, argument_count, info):
temp_version = [0]
converted_arguments = []
target_parameters = []
for position, arg in enumerate(arguments[:argument_count]):
conversion = self._InputConversion(arg.type.id, info.declared_name)
param_name = arguments[position].id
if conversion:
temp_version[0] += 1
temp_name = '%s_%s' % (param_name, temp_version[0])
temp_type = conversion.output_type
stmts_emitter.Emit(
'$(INDENT)$TYPE $NAME = $CONVERT($ARG);\n',
TYPE=TypeOrVar(temp_type),
NAME=temp_name,
CONVERT=conversion.function_name,
ARG=info.param_infos[position].name)
converted_arguments.append(temp_name)
param_type = temp_type
verified_type = temp_type # verified by assignment in checked mode.
else:
converted_arguments.append(info.param_infos[position].name)
param_type = self._NarrowInputType(arg.type.id)
# Verified by argument checking on entry to the dispatcher.
verified_type = self._InputType(
info.param_infos[position].type_id, info)
# The native method does not need an argument type if we know the type.
# But we do need the native methods to have correct function types, so
# be conservative.
if param_type == verified_type:
if param_type in ['String', 'num', 'int', 'double', 'bool', 'Object']:
param_type = 'dynamic'
target_parameters.append(
'%s%s' % (TypeOrNothing(param_type), param_name))
return target_parameters, converted_arguments
def _InputType(self, type_name, info):
conversion = self._InputConversion(type_name, info.declared_name)
if conversion:
return conversion.input_type
else:
return self._NarrowInputType(type_name) if type_name else 'dynamic'
def _AddOperationWithConversions(self, info, html_name):
# Assert all operations have same return type.
assert len(set([op.type.id for op in info.operations])) == 1
@ -1011,57 +1058,21 @@ class Dart2JSBackend(HtmlDartGenerator):
return_type = self._NarrowInputType(info.type_name)
native_return_type = return_type
def InputType(type_name):
conversion = self._InputConversion(type_name, info.declared_name)
if conversion:
return conversion.input_type
else:
return self._NarrowInputType(type_name) if type_name else 'dynamic'
parameter_names = [param_info.name for param_info in info.param_infos]
parameter_types = [InputType(param_info.type_id)
parameter_types = [self._InputType(param_info.type_id, info)
for param_info in info.param_infos]
operations = info.operations
temp_version = [0]
def InputType(type_name):
return self._InputType(type_name, info)
def GenerateCall(
stmts_emitter, call_emitter, version, operation, argument_count):
target = '_%s_%d' % (
html_name[1:] if html_name.startswith('_') else html_name, version);
arguments = []
target_parameters = []
for position, arg in enumerate(operation.arguments[:argument_count]):
conversion = self._InputConversion(arg.type.id, operation.id)
param_name = operation.arguments[position].id
if conversion:
temp_version[0] += 1
temp_name = '%s_%s' % (param_name, temp_version[0])
temp_type = conversion.output_type
stmts_emitter.Emit(
'$(INDENT)$TYPE $NAME = $CONVERT($ARG);\n',
TYPE=TypeOrVar(temp_type),
NAME=temp_name,
CONVERT=conversion.function_name,
ARG=parameter_names[position])
arguments.append(temp_name)
param_type = temp_type
verified_type = temp_type # verified by assignment in checked mode.
else:
arguments.append(parameter_names[position])
param_type = self._NarrowInputType(arg.type.id)
# Verified by argument checking on entry to the dispatcher.
verified_type = InputType(info.param_infos[position].type_id)
# The native method does not need an argument type if we know the type.
# But we do need the native methods to have correct function types, so
# be conservative.
if param_type == verified_type:
if param_type in ['String', 'num', 'int', 'double', 'bool', 'Object']:
param_type = 'dynamic'
target_parameters.append(
'%s%s' % (TypeOrNothing(param_type), param_name))
(target_parameters, arguments) = self._ConvertArgumentTypes(
stmts_emitter, operation.arguments, argument_count, info)
argument_list = ', '.join(arguments)
# TODO(sra): If the native method has zero type checks, we can 'inline' is

View file

@ -393,6 +393,9 @@ class DartiumBackend(HtmlDartGenerator):
def CustomJSMembers(self):
return {}
def _InputConversion(self, type_name, info):
return None
def GenerateCallback(self, info):
if IsPureInterface(self._interface.id) or IsCustomType(self._interface.id):
return

View file

@ -15,13 +15,7 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
if (lang != null) parsedOptions['lang'] = lang;
if (tag != null) parsedOptions['tag'] = tag;
if (icon != null) parsedOptions['icon'] = icon;
var nativeOptions;
$if DART2JS
nativeOptions = convertDartToNative_Dictionary(parsedOptions);
$else
nativeOptions = parsedOptions;
$endif
return $CLASSNAME._factory$CLASSNAME(title, nativeOptions);
return $CLASSNAME._factory$CLASSNAME(title, parsedOptions);
}
$!MEMBERS
}