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

Unified Diff: sdk/lib/_internal/js_runtime/lib/custom_patch.dart

Issue 2098493002: WIP: Add custom platform library. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add argument. Created 4 years, 6 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: sdk/lib/_internal/js_runtime/lib/custom_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/custom_patch.dart b/sdk/lib/_internal/js_runtime/lib/custom_patch.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f1e09bac7bfe5be0d82d8eaa60aa0f3541d701b7
--- /dev/null
+++ b/sdk/lib/_internal/js_runtime/lib/custom_patch.dart
@@ -0,0 +1,9 @@
+import 'dart:_js_helper' show patch;
+import 'dart:_foreign_helper' show JS;
+
+@patch
+void externalMethod(String argument) {
+ // This is a call to the 'magic' JS function that generates JavaScript using
+ // the second argument as a template.
+ JS('void', 'print("External method in dart:custom: " + #)', argument);
+}

Powered by Google App Engine
This is Rietveld 408576698