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

Unified Diff: test/codegen/expect/_js_primitives/_js_primitives.js

Issue 962083002: support the JS builtin (Closed) Base URL: git@github.com:dart-lang/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
Index: test/codegen/expect/_js_primitives/_js_primitives.js
diff --git a/test/codegen/expect/_js_primitives/_js_primitives.js b/test/codegen/expect/_js_primitives/_js_primitives.js
index 4112fcd910b6a6ea1baa2624eeea8e0af4ee9be4..af32b2f09ce66623d1c5fa895eb1308c539053fd 100644
--- a/test/codegen/expect/_js_primitives/_js_primitives.js
+++ b/test/codegen/expect/_js_primitives/_js_primitives.js
@@ -3,22 +3,22 @@ var _js_primitives;
'use strict';
// Function printString: (String) → void
function printString(string) {
- if (_foreign_helper.JS('bool', 'typeof dartPrint == "function"')) {
- _foreign_helper.JS('void', 'dartPrint(#)', string);
+ if (typeof dartPrint == "function") {
+ dartPrint(string);
return;
}
- if (dart.dbinary(_foreign_helper.JS('bool', 'typeof console == "object"'), '&&', _foreign_helper.JS('bool', 'typeof console.log != "undefined"'))) {
- _foreign_helper.JS('void', 'console.log(#)', string);
+ if (dart.notNull(typeof console == "object") && dart.notNull(typeof console.log != "undefined")) {
+ console.log(string);
return;
}
- if (_foreign_helper.JS('bool', 'typeof window == "object"')) {
+ if (typeof window == "object") {
return;
}
- if (_foreign_helper.JS('bool', 'typeof print == "function"')) {
- _foreign_helper.JS('void', 'print(#)', string);
+ if (typeof print == "function") {
+ print(string);
return;
}
- _foreign_helper.JS('void', 'throw "Unable to print message: " + String(#)', string);
+ throw "Unable to print message: " + String(string);
}
// Exports:
_js_primitives.printString = printString;
« no previous file with comments | « test/codegen/expect/_js_names/_js_names.js ('k') | test/codegen/expect/_native_typed_data/_native_typed_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698