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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 219053003: Deprecate automatic generation of precompiled.js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 /** 7 /**
8 * Generates the code for all used classes in the program. Static fields (even 8 * Generates the code for all used classes in the program. Static fields (even
9 * in classes) are ignored, since they can be treated as non-class elements. 9 * in classes) are ignored, since they can be treated as non-class elements.
10 * 10 *
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 compiler.sourceMapUri, compiler.outputUri); 1537 compiler.sourceMapUri, compiler.outputUri);
1538 sourceMapTags = 1538 sourceMapTags =
1539 generateSourceMapTag(compiler.sourceMapUri, compiler.outputUri); 1539 generateSourceMapTag(compiler.sourceMapUri, compiler.outputUri);
1540 } 1540 }
1541 compiler.outputProvider('', 'js') 1541 compiler.outputProvider('', 'js')
1542 ..add(assembledCode) 1542 ..add(assembledCode)
1543 ..add(sourceMapTags) 1543 ..add(sourceMapTags)
1544 ..close(); 1544 ..close();
1545 compiler.assembledCode = assembledCode; 1545 compiler.assembledCode = assembledCode;
1546 1546
1547 if (!compiler.useContentSecurityPolicy) {
1548 mainBuffer.write("""
1549 {
1550 var message =
1551 'Deprecation: Automatic generation of output for Content Security\\n' +
1552 'Policy is deprecated and will be removed with the next development\\n' +
1553 'release. Use the --csp option to generate the precompiled.js output\\n' +
floitsch 2014/03/31 12:53:26 space at end of line?
floitsch 2014/03/31 12:53:26 Should we generate "precompiled.js" or generate to
Johnni Winther 2014/04/01 08:20:21 Removed.
Johnni Winther 2014/04/01 08:20:21 Done.
1554 'without this message.';
1555 if (typeof dartPrint == "function") {
1556 dartPrint(message);
1557 } else if (typeof console == "object" && typeof console.log == "function") {
1558 console.log(message);
1559 } else if (typeof print == "function") {
1560 print(message);
1561 }
1562 }\n""");
1563 }
1547 mainBuffer.write( 1564 mainBuffer.write(
1548 jsAst.prettyPrint( 1565 jsAst.prettyPrint(
1549 precompiledFunctionAst, compiler, 1566 precompiledFunctionAst, compiler,
1550 allowVariableMinification: false).getText()); 1567 allowVariableMinification: false).getText());
1551 1568
1552 compiler.outputProvider('', 'precompiled.js') 1569 compiler.outputProvider('', 'precompiled.js')
1553 ..add(mainBuffer.getText()) 1570 ..add(mainBuffer.getText())
1554 ..close(); 1571 ..close();
1555 1572
1556 emitDeferredCode(); 1573 emitDeferredCode();
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 String sourceMap = sourceMapBuilder.build(compiledFile); 1694 String sourceMap = sourceMapBuilder.build(compiledFile);
1678 compiler.outputProvider(name, 'js.map') 1695 compiler.outputProvider(name, 'js.map')
1679 ..add(sourceMap) 1696 ..add(sourceMap)
1680 ..close(); 1697 ..close();
1681 } 1698 }
1682 1699
1683 void registerReadTypeVariable(TypeVariableElement element) { 1700 void registerReadTypeVariable(TypeVariableElement element) {
1684 readTypeVariables.add(element); 1701 readTypeVariables.add(element);
1685 } 1702 }
1686 } 1703 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart2js.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698