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

Unified Diff: tool/input_sdk/lib/js/dart2js/js_dart2js.dart

Issue 1528613004: First cut of mini dart:html. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix build_sdk Created 5 years 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 | « tool/input_sdk/lib/html/html_common/metadata.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/lib/js/dart2js/js_dart2js.dart
diff --git a/tool/input_sdk/lib/js/dart2js/js_dart2js.dart b/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
index dcdb64463ef81ed5cccc8df6d6f777e6566c8ccf..08449bd25534f3fc41a05a851a1f618687327f81 100644
--- a/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
+++ b/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
@@ -93,7 +93,8 @@ import 'dart:_interceptors' as _interceptors show JSArray;
import 'dart:_js_helper' show Primitives;
import 'dart:_foreign_helper' show JS;
-final JsObject context = _wrapToDart(JS('', 'dart.global'));
+final _global = JS('', 'dart.global');
+final JsObject context = _wrapToDart(_global);
/**
* Proxies a JavaScript object to Dart.
@@ -474,12 +475,13 @@ dynamic _wrapDartFunction(f) {
// converts a Dart object to a reference to a native JS object
// which might be a DartObject JS->Dart proxy
-Object _convertToDart(o) {
+Object _convertToDart(o, [bool isBrowserType(x)]) {
+ if (isBrowserType == null) isBrowserType = _isBrowserType;
if (JS('bool', '# == null', o) ||
JS('bool', 'typeof # == "string"', o) ||
JS('bool', 'typeof # == "number"', o) ||
JS('bool', 'typeof # == "boolean"', o) ||
- _isBrowserType(o)) {
+ isBrowserType(o)) {
return o;
} else if (JS('bool', '# instanceof Date', o)) {
var ms = JS('num', '#.getTime()', o);
@@ -554,4 +556,4 @@ Function allowInteropCaptureThis(Function f) {
_interopCaptureThisExpando[f] = ret;
}
return ret;
-}
+}
« no previous file with comments | « tool/input_sdk/lib/html/html_common/metadata.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698