Description[js-interop] Fix function binding and avoid noSuchMethod when using map notation
This change does two things:
(1) It avoids noSuchMethod and dartbug.com/9283 when map notation is
used. I don't like losing the varargs-like behavior of NSM, so I'm
not entirely sure we should land this part.
(2) This also binds receivers on returned functions to make
a['foo']() and a.foo() equivalent. JS has odd semantics around this.
In JS:
a['foo']()
a is the receiver (i.e., the "this") in the function invocation. But, in the following:
var tmp = a['foo'];
tmp();
it is not. We don't distinguish between the two in js-interop. This
change essentially forces the former semantics over the latter.
Note: kevmoo's pop-pop-win app in dartbug.com/9283 works with in
dart2js minified with these changes along with the source change in
comment #15.
Committed: https://github.com/dart-lang/js-interop/commit/e561ab6
Patch Set 1 #Patch Set 2 : Added comment on NSM removal #Patch Set 3 : Fix for constructors plus cleanup #
Total comments: 4
Messages
Total messages: 10 (0 generated)
|