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

Unified Diff: compiler/lib/implementation/core.js

Issue 8566022: Function type checking (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup / refactor Created 9 years, 1 month 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: compiler/lib/implementation/core.js
diff --git a/compiler/lib/implementation/core.js b/compiler/lib/implementation/core.js
index 12456e177d59536d665a777addf1551aa8f82320..bfdc313cb8efb255cd1993a17717290b0d5e8cc1 100644
--- a/compiler/lib/implementation/core.js
+++ b/compiler/lib/implementation/core.js
@@ -156,19 +156,26 @@ function $inherits(child, parent) {
* @param {...*} var_args
*/
function $bind(fn, thisObj, var_args) {
+ var func;
if (arguments.length > 2) {
var boundArgs = Array.prototype.slice.call(arguments, 2);
- return function() {
+ func = function() {
// Prepend the bound arguments to the current arguments.
var newArgs = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(newArgs, boundArgs);
return fn.apply(thisObj, newArgs);
};
} else {
- return function() {
+ func = function() {
return fn.apply(thisObj, arguments);
};
}
+ if(fn.$lookupRTT) {
+ func.$lookupRTT = function() {
+ return fn.$lookupRTT.apply(thisObj, arguments);
+ };
+ }
+ return func;
}
/**

Powered by Google App Engine
This is Rietveld 408576698