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

Unified Diff: pkg/compiler/lib/src/js/js.dart

Issue 1576063003: dart2js cps: Translate identity placeholders to refinement nodes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase again 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/finalize.dart ('k') | tests/compiler/dart2js/cps_ir/expected/operators2_3.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/js.dart
diff --git a/pkg/compiler/lib/src/js/js.dart b/pkg/compiler/lib/src/js/js.dart
index 274236a9763031f30433d85ab9a9b616fb8b5162..df510a854fcbb38363ccd9028427d0b70f267b38 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -182,6 +182,12 @@ class UnparsedNode extends DeferredString
String get value => _literal.value;
}
+/// True if the given template consists of just a placeholder. Such templates
+/// are sometimes used to manually promote the type of an expression.
+bool isIdentityTemplate(Template template) {
+ return template.ast is InterpolatedExpression;
+}
+
/// Returns `true` if [template] will immediately give a TypeError if the first
/// placeholder is `null` or `undefined`.
bool isNullGuardOnFirstArgument(Template template) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/finalize.dart ('k') | tests/compiler/dart2js/cps_ir/expected/operators2_3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698