@@ -484,8 +484,10 @@ void _installPropertiesForGlobalObject(jsProto) {
484
484
485
485
final _extensionMap = JS ('' , 'new Map()' );
486
486
487
+ /// Adds Dart properties to native JS types.
487
488
void _applyExtension (jsType, dartExtType) {
488
- // TODO(vsm): Not all registered js types are real.
489
+ // Exit early when encountering a JS type without a prototype (such as
490
+ // structs).
489
491
if (jsType == null ) return ;
490
492
var jsProto = JS <Object ?>('' , '#.prototype' , jsType);
491
493
if (jsProto == null ) return ;
@@ -509,7 +511,11 @@ void _applyExtension(jsType, dartExtType) {
509
511
if (JS ('!' , '# !== #' , dartExtType, JS_CLASS_REF (JSFunction ))) {
510
512
JS ('' , '#[#] = #' , jsProto, _extensionType, dartExtType);
511
513
}
514
+
515
+ // Attach member signature tags.
512
516
JS ('' , '#[#] = #[#]' , jsType, _methodSig, dartExtType, _methodSig);
517
+ JS ('' , '#[#] = #[#]' , jsType, _methodsDefaultTypeArgSig, dartExtType,
518
+ _methodsDefaultTypeArgSig);
513
519
JS ('' , '#[#] = #[#]' , jsType, _fieldSig, dartExtType, _fieldSig);
514
520
JS ('' , '#[#] = #[#]' , jsType, _getterSig, dartExtType, _getterSig);
515
521
JS ('' , '#[#] = #[#]' , jsType, _setterSig, dartExtType, _setterSig);
0 commit comments