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

Unified Diff: lib/src/codegen/js_interop.dart

Issue 1530563003: Generate all runtime files from dart. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: simplify diff in js_codegen.dart Created 4 years, 11 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: lib/src/codegen/js_interop.dart
diff --git a/lib/src/codegen/js_interop.dart b/lib/src/codegen/js_interop.dart
index 777a0097bde7e47720d2dd05638683a0c11c2baf..470efed9574a6fa42777929b2a6a8355c44589f1 100644
--- a/lib/src/codegen/js_interop.dart
+++ b/lib/src/codegen/js_interop.dart
@@ -48,3 +48,13 @@ bool isJSExportNameAnnotation(DartObjectImpl value) {
bool isJsPeerInterface(DartObjectImpl value) =>
value.type.name == 'JsPeerInterface';
+
+/// Whether this invocation represents a `genericTypeConstructor` intrinsic
+/// call, meant to be used only inside `JS` templates.
+///
+/// That intrinsic function is only to be used in JS expressions inside the SDK.
+/// For instance `JS('', '#(type)', genericTypeConstructor(List))` will
+/// generate `core.List$(type)`.
+bool isGenericTypeConstructorIntrinsic(MethodInvocation i) =>
+ _isJsLibType('genericTypeConstructor', i.methodName?.bestElement) &&
+ i.argumentList.arguments.length == 1;

Powered by Google App Engine
This is Rietveld 408576698