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

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

Issue 1448993002: Switch ddc to use @JS instead of @JSName (Closed) Base URL: git://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 1 month 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 | « lib/runtime/dart/js.js ('k') | lib/src/codegen/js_interop.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 4e376ded4c78af616ad6223560a2f8ee6b609a5e..0dd62fd6d66a560036728d90a15671685a87c050 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -248,7 +248,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
void visitLibraryDirective(LibraryDirective node) {
assert(_jsModuleValue == null);
- var jsName = findAnnotation(node.element, isJsNameAnnotation);
+ var jsName = findAnnotation(node.element, isJSAnnotation);
_jsModuleValue =
getConstantField(jsName, 'name', types.stringType)?.toStringValue();
}
@@ -409,7 +409,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
if (jsTypeName != null && jsTypeName != dartClassName) {
// We export the JS type as if it was a Dart type. For example this allows
// `dom.InputElement` to actually be HTMLInputElement.
- // TODO(jmesserly): if we had the JsName on the Element, we could just
+ // TODO(jmesserly): if we had the JS name on the Element, we could just
// generate it correctly when we refer to it.
if (isPublic(dartClassName)) _addExport(dartClassName);
return js.statement('let # = #;', [dartClassName, jsTypeName]);
@@ -421,7 +421,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
JS.Statement visitClassDeclaration(ClassDeclaration node) {
var classElem = node.element;
var type = classElem.type;
- var jsName = findAnnotation(classElem, isJsNameAnnotation);
+ var jsName = findAnnotation(classElem, isJSAnnotation);
if (jsName != null) return _emitJsType(node.name.name, jsName);
@@ -2721,7 +2721,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
// TODO(jmesserly): ideally we'd check the method and see if it is marked
// `external`, but that doesn't work because it isn't in the element model.
bool _useNativeJsIndexer(DartType type) =>
- findAnnotation(type.element, isJsNameAnnotation) != null;
+ findAnnotation(type.element, isJSAnnotation) != null;
/// Gets the target of a [PropertyAccess], [IndexExpression], or
/// [MethodInvocation]. These three nodes can appear in a [CascadeExpression].
« no previous file with comments | « lib/runtime/dart/js.js ('k') | lib/src/codegen/js_interop.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698