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

Unified Diff: lib/runtime/dart_runtime.js

Issue 949383003: use js_ast instead of strings to generate JS (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | lib/src/codegen/js_codegen.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index f56e6be0ec90546b251d1541f262cb8dcaf3e56d..58641ea5be693f7d87622a5a3823c8770b3b197a 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -38,6 +38,7 @@ var dart;
}
dart.dload = dload;
+ // TODO(jmesserly): this should call noSuchMethod, not throw.
function throwNoSuchMethod(obj, name, args, opt_func) {
if (obj === void 0) obj = opt_func;
throw new core.NoSuchMethodError(obj, name, args);
@@ -266,6 +267,9 @@ var dart;
}
dart.assert = assert;
+ function throw_(obj) { throw obj; }
+ dart.throw_ = throw_;
+
/**
* Given a class and an initializer method name, creates a constructor
* function with the same name. For example `new SomeClass.name(args)`.
@@ -341,7 +345,9 @@ var dart;
// Get the class name for this instance.
var name = this.constructor.name;
// Call the default constructor.
- var result = this[name].apply(this, arguments);
+ var init = this[name];
+ var result = void 0;
+ if (init) result = init.apply(this, arguments);
return result === void 0 ? this : result;
};
// The initializer for dart.Object
« no previous file with comments | « no previous file | lib/src/codegen/js_codegen.dart » ('j') | lib/src/codegen/js_codegen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698