Fix Object method tearoffs

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2953933002 .
This commit is contained in:
Vijay Menon 2017-06-22 15:59:44 -07:00
parent 89eda8a533
commit daf960d5a4
2 changed files with 7 additions and 4 deletions

View file

@ -4802,8 +4802,13 @@ class CodeGenerator extends Object
result = _callHelper('bind(this, #, #)',
[safeName, _emitTargetAccess(jsTarget, name, accessor)]);
} else if (_isObjectMemberCall(target, memberName)) {
result = _callHelper('bind(#, #, #.#)',
[jsTarget, _propertyName(memberName), _runtimeModule, memberName]);
var fn = js.call(
memberName == 'noSuchMethod'
? 'function(i) { return #.#(this, i); }'
: 'function() { return #.#(this); }',
[_runtimeModule, memberName]);
result = _callHelper(
'bind(#, #, #)', [jsTarget, _propertyName(memberName), fn]);
} else {
result = _callHelper('bind(#, #)', [jsTarget, safeName]);
}

View file

@ -267,10 +267,8 @@ define(['dart_sdk', 'async_helper', 'expect', 'unittest', 'is', 'require'],
'list_set_all_test': fail,
'list_test_01_multi': fail,
'list_test_none_multi': fail,
'list_to_string2_test': fail,
'main_test': fail,
'map_keys2_test': fail,
'map_to_string_test': fail,
'map_from_iterable_test': is.firefox('<=50') ? fail : pass,
'nan_infinity_test_01_multi': fail,
'null_nosuchmethod_test': fail,