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

Unified Diff: lib/src/js/module_transform.dart

Issue 1458243002: implement ES6 modules in JS AST. (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
Index: lib/src/js/module_transform.dart
diff --git a/lib/src/js/module_transform.dart b/lib/src/js/module_transform.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8ef9ccffc942515ef4b84d74f0f93f7432de4892
--- /dev/null
+++ b/lib/src/js/module_transform.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of js_ast;
+
+/**
+ * Transforms EcmaScript 6 modules to an ES 5 file using a module pattern.
+ *
+ * There are various module patterns in JavaScript, see
+ * <http://babeljs.io/docs/usage/modules/> for some examples.
+ *
+ * At the moment, we only support our "custom Dart" conversion, roughly similar
+ * to Asynchronous Module Definition (AMD), see also
+ * <http://requirejs.org/docs/whyamd.html>. Like AMD, module files can
+ * be loaded directly in the browser with no further transformation (e.g.
+ * browserify, webpack).
+ */
+// TODO(jmesserly): deprecate the "custom dart" form in favor of AMD.
+class CustomDartModuleTransform extends BaseVisitor {
+ // TODO(jmesserly): implement these. Module should transform to Program.
+ visitImportDeclaration(ImportDeclaration node) {}
+ visitExportDeclaration(ExportDeclaration node) {}
+ visitModule(Module node) {}
+}
« no previous file with comments | « lib/src/js/js_ast.dart ('k') | lib/src/js/nodes.dart » ('j') | lib/src/js/nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698