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

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

Issue 955513008: cleans up sdk patching so we no longer have unresolved names (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
new file mode 100644
index 0000000000000000000000000000000000000000..4112fcd910b6a6ea1baa2624eeea8e0af4ee9be4
--- /dev/null
+++ b/test/codegen/expect/_js_primitives/_js_primitives.js
@@ -0,0 +1,25 @@
+var _js_primitives;
+(function(_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);
+ 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);
+ return;
+ }
+ if (_foreign_helper.JS('bool', 'typeof window == "object"')) {
+ return;
+ }
+ if (_foreign_helper.JS('bool', 'typeof print == "function"')) {
+ _foreign_helper.JS('void', 'print(#)', string);
+ return;
+ }
+ _foreign_helper.JS('void', 'throw "Unable to print message: " + String(#)', string);
+ }
+ // Exports:
+ _js_primitives.printString = printString;
+})(_js_primitives || (_js_primitives = {}));
« 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