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

Unified Diff: test/codegen_test.dart

Issue 1677863002: Use default params when --destructure-named-params + fix renaming of reserved destructured params (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 | « test/codegen/expect/destructuring.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index 70f5a23f139a85413716e5e1ccbe4e000709916a..ba4c447028f05228ed64c72b18e2d830fb19a089 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -67,6 +67,7 @@ main(arguments) {
BatchCompiler createCompiler(AnalysisContext context,
{bool checkSdk: false,
bool sourceMaps: false,
+ bool destructureNamedParams: false,
bool closure: false,
ModuleFormat moduleFormat: ModuleFormat.legacy}) {
// TODO(jmesserly): add a way to specify flags in the test file, so
@@ -77,6 +78,7 @@ main(arguments) {
outputDir: expectDir,
emitSourceMaps: sourceMaps,
closure: closure,
+ destructureNamedParams: destructureNamedParams,
forceCompile: checkSdk,
moduleFormat: moduleFormat),
useColors: false,
@@ -157,6 +159,7 @@ $compilerMessages''';
// We need a more comprehensive strategy to test them.
var sourceMaps = filename == 'map_keys';
var closure = filename == 'closure';
+ var destructureNamedParams = filename == 'destructuring' || closure;
var moduleFormat = filename == 'es6_modules'
? ModuleFormat.es6
: filename == 'node_modules'
@@ -166,13 +169,16 @@ $compilerMessages''';
// TODO(vsm): Is it okay to reuse the same context here? If there is
// overlap between test files, we may need separate ones for each
// compiler.
- var compiler =
- (sourceMaps || closure || moduleFormat != ModuleFormat.legacy)
- ? createCompiler(realSdkContext,
- sourceMaps: sourceMaps,
- closure: closure,
- moduleFormat: moduleFormat)
- : batchCompiler;
+ var compiler = (sourceMaps ||
+ closure ||
+ destructureNamedParams ||
+ moduleFormat != ModuleFormat.legacy)
+ ? createCompiler(realSdkContext,
+ sourceMaps: sourceMaps,
+ destructureNamedParams: destructureNamedParams,
+ closure: closure,
+ moduleFormat: moduleFormat)
+ : batchCompiler;
success = compile(compiler, filePath);
var outFile = new File(path.join(outDir.path, '$filename.js'));
« no previous file with comments | « test/codegen/expect/destructuring.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698