define method
void
define(
- String name,
- CustomElementConstructor constructor, [
- List<
String> attributes = const <String>[]
Implementation
void define(
String name,
CustomElementConstructor constructor, [
List<String> attributes = const <String>[],
]) {
final count = attributes.length;
final jsAttributes = JSArray<JSString>.withLength(count);
for (var i = 0; i < count; ++i) {
jsAttributes[i] = attributes[i].toJS;
}
JSBoxedDartObject construct(js.HTMLElement jsObject) =>
constructor(jsObject).toJSBox;
jsObject.define(name, construct.toJS, jsAttributes);
}