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

Unified Diff: lib/compiler/implementation/lib/native_helper.dart

Issue 10533151: Make undefined and null equivalent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 8 years, 6 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
Index: lib/compiler/implementation/lib/native_helper.dart
diff --git a/lib/compiler/implementation/lib/native_helper.dart b/lib/compiler/implementation/lib/native_helper.dart
index 96c3a3ed68a14f82e11419c656f4faba8de01e25..c5ab8698b768fa5123b182322cd317728c951bc1 100644
--- a/lib/compiler/implementation/lib/native_helper.dart
+++ b/lib/compiler/implementation/lib/native_helper.dart
@@ -164,18 +164,11 @@ dynamicBind(var obj,
proto, DART_CLOSURE_TO_JS(throwNoSuchMethod), name, name);
}
- var nullCheckMethod = JS('var',
- 'function() {'
- 'var res = #.apply(this, Array.prototype.slice.call(arguments));'
- 'return res === null ? (void 0) : res;'
- '}',
- method);
-
if (JS('bool', '!#.hasOwnProperty(#)', proto, name)) {
- defineProperty(proto, name, nullCheckMethod);
+ defineProperty(proto, name, method);
}
- return JS('var', '#.apply(#, #)', nullCheckMethod, obj, arguments);
+ return JS('var', '#.apply(#, #)', method, obj, arguments);
}
/**

Powered by Google App Engine
This is Rietveld 408576698