Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: lib/runtime/_operations.js

Issue 1243503007: fixes #221, initial sync*, async, async* implementation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/_generators.js ('k') | lib/runtime/dart/_isolate_helper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/_operations.js
diff --git a/lib/runtime/_operations.js b/lib/runtime/_operations.js
index 822054efbb0a3632ab7fd5f3059cd27a51ab6832..1d3997d06e5e16f62c869ce4e210b1755048615f 100644
--- a/lib/runtime/_operations.js
+++ b/lib/runtime/_operations.js
@@ -152,13 +152,13 @@ dart_library.library('dart_runtime/_operations', null, /* Imports */[
/** Shared code for dsend, dindex, and dsetindex. */
function callMethod(obj, name, args, displayName) {
let symbol = _canonicalFieldName(obj, name, args, displayName);
- let f = obj[symbol];
+ let f = obj != null ? obj[symbol] : null;
let ftype = classes.getMethodType(obj, name);
return checkAndCall(f, ftype, obj, args, displayName);
}
function dsend(obj, method/*, ...args*/) {
- return callMethod(obj, method, slice.call(arguments, 2));
+ return callMethod(obj, method, slice.call(arguments, 2), method);
}
exports.dsend = dsend;
@@ -180,8 +180,11 @@ dart_library.library('dart_runtime/_operations', null, /* Imports */[
if (isSubtype(type, core.Iterable) && isSubtype(actual, core.Iterable) ||
isSubtype(type, async.Future) && isSubtype(actual, async.Future) ||
isSubtype(type, core.Map) && isSubtype(actual, core.Map) ||
- isSubtype(type, core.Function) && isSubtype(actual, core.Function)) {
- console.error('Ignoring cast fail from ' + types.typeName(actual) +
+ isSubtype(type, core.Function) && isSubtype(actual, core.Function) ||
+ isSubtype(type, async.Stream) && isSubtype(actual, async.Stream) ||
+ isSubtype(type, async.StreamSubscription) &&
+ isSubtype(actual, async.StreamSubscription)) {
+ console.warn('Ignoring cast fail from ' + types.typeName(actual) +
' to ' + types.typeName(type));
return true;
}
« no previous file with comments | « lib/runtime/_generators.js ('k') | lib/runtime/dart/_isolate_helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698