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

Side by Side Diff: lib/src/js_ast/module_transform.dart

Issue 2249233002: fix #626, add AMD module format and make it default (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: merged Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « lib/src/compiler/module_builder.dart ('k') | lib/src/js_ast/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of js_ast; 5 part of js_ast;
6 6
7 /** 7 /**
8 * Transforms EcmaScript 6 modules to an ES 5 file using a module pattern. 8 * Transforms ECMAScript 6 modules to an ES 5 file using a module pattern.
9 * 9 *
10 * There are various module patterns in JavaScript, see 10 * There are various module patterns in JavaScript, see
11 * <http://babeljs.io/docs/usage/modules/> for some examples. 11 * <http://babeljs.io/docs/usage/modules/> for some examples.
12 * 12 *
13 * At the moment, we only support our "custom Dart" conversion, roughly similar 13 * At the moment, we only support our "custom Dart" conversion, roughly similar
14 * to Asynchronous Module Definition (AMD), see also 14 * to Asynchronous Module Definition (AMD), see also
15 * <http://requirejs.org/docs/whyamd.html>. Like AMD, module files can 15 * <http://requirejs.org/docs/whyamd.html>. Like AMD, module files can
16 * be loaded directly in the browser with no further transformation (e.g. 16 * be loaded directly in the browser with no further transformation (e.g.
17 * browserify, webpack). 17 * browserify, webpack).
18 */ 18 */
19 // TODO(jmesserly): deprecate the "custom dart" form in favor of AMD. 19 // TODO(jmesserly): deprecate the "custom dart" form in favor of AMD.
20 class CustomDartModuleTransform extends BaseVisitor { 20 class CustomDartModuleTransform extends BaseVisitor {
21 // TODO(jmesserly): implement these. Module should transform to Program. 21 // TODO(jmesserly): implement these. Module should transform to Program.
22 visitImportDeclaration(ImportDeclaration node) {} 22 visitImportDeclaration(ImportDeclaration node) {}
23 visitExportDeclaration(ExportDeclaration node) {} 23 visitExportDeclaration(ExportDeclaration node) {}
24 visitModule(Module node) {} 24 visitModule(Module node) {}
25 } 25 }
OLDNEW
« no previous file with comments | « lib/src/compiler/module_builder.dart ('k') | lib/src/js_ast/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698