| Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
|
| index 231035a42efce9cc6a30e789781a8005e7d5bc2b..3418c9aec9fca13e7b506b5afbd867dc790794e0 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
|
| @@ -1530,6 +1530,14 @@ if (typeof $printHelperName === "function") {
|
| } else {
|
| mainBuffer.add('\n');
|
| }
|
| +
|
| + if (compiler.useContentSecurityPolicy) {
|
| + mainBuffer.write(
|
| + jsAst.prettyPrint(
|
| + precompiledFunctionAst, compiler,
|
| + allowVariableMinification: false).getText());
|
| + }
|
| +
|
| String assembledCode = mainBuffer.getText();
|
| String sourceMapTags = "";
|
| if (generateSourceMap) {
|
| @@ -1544,15 +1552,31 @@ if (typeof $printHelperName === "function") {
|
| ..close();
|
| compiler.assembledCode = assembledCode;
|
|
|
| - mainBuffer.write(
|
| - jsAst.prettyPrint(
|
| - precompiledFunctionAst, compiler,
|
| - allowVariableMinification: false).getText());
|
| + if (!compiler.useContentSecurityPolicy) {
|
| + mainBuffer.write("""
|
| +{
|
| + var message =
|
| + 'Deprecation: Automatic generation of output for Content Security\\n' +
|
| + 'Policy is deprecated and will be removed with the next development\\n' +
|
| + 'release. Use the --csp option to generate CSP restricted output.';
|
| + if (typeof dartPrint == "function") {
|
| + dartPrint(message);
|
| + } else if (typeof console == "object" && typeof console.log == "function") {
|
| + console.log(message);
|
| + } else if (typeof print == "function") {
|
| + print(message);
|
| + }
|
| +}\n""");
|
|
|
| - compiler.outputProvider('', 'precompiled.js')
|
| - ..add(mainBuffer.getText())
|
| - ..close();
|
| + mainBuffer.write(
|
| + jsAst.prettyPrint(
|
| + precompiledFunctionAst, compiler,
|
| + allowVariableMinification: false).getText());
|
|
|
| + compiler.outputProvider('', 'precompiled.js')
|
| + ..add(mainBuffer.getText())
|
| + ..close();
|
| + }
|
| emitDeferredCode();
|
|
|
| });
|
|
|