Skip to content

Commit 2592044

Browse files
committed
Version 1.8.0-dev.4.1
svn merge -c 41704 https://dart.googlecode.com/svn/branches/bleeding_edge trunk svn merge -c 41705 https://dart.googlecode.com/svn/branches/bleeding_edge trunk svn merge -c 41711 https://dart.googlecode.com/svn/branches/bleeding_edge trunk git-svn-id: http://dart.googlecode.com/svn/trunk@41762 260f80e4-7a28-3924-810f-c04153c831b5
1 parent 0f34f62 commit 2592044

23 files changed

+92
-127
lines changed

pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,34 +1672,6 @@ class OldEmitter implements Emitter {
16721672
..add(assembledCode)
16731673
..close();
16741674
compiler.assembledCode = assembledCode;
1675-
1676-
if (!compiler.useContentSecurityPolicy) {
1677-
CodeBuffer cspBuffer = new CodeBuffer();
1678-
cspBuffer.add(mainBuffer);
1679-
cspBuffer.write("""
1680-
{
1681-
var message =
1682-
'Deprecation: Automatic generation of output for Content Security\\n' +
1683-
'Policy is deprecated and will be removed with the next development\\n' +
1684-
'release. Use the --csp option to generate CSP restricted output.';
1685-
if (typeof dartPrint == "function") {
1686-
dartPrint(message);
1687-
} else if (typeof console == "object" && typeof console.log == "function") {
1688-
console.log(message);
1689-
} else if (typeof print == "function") {
1690-
print(message);
1691-
}
1692-
}\n""");
1693-
1694-
cspBuffer.write(
1695-
jsAst.prettyPrint(
1696-
precompiledFunctionAst, compiler,
1697-
allowVariableMinification: false).getText());
1698-
1699-
compiler.outputProvider('', 'precompiled.js')
1700-
..add(cspBuffer.getText())
1701-
..close();
1702-
}
17031675
}
17041676

17051677
/// Returns a map from OutputUnit to a hash of its content. The hash uniquely

runtime/lib/errors_patch.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'dart:mirrors' show MirrorSystem;
6+
import 'dart:convert' show JSON;
67

78
patch class Error {
89
/* patch */ static String _objectToString(Object object) {
910
return Object._toString(object);
1011
}
1112

13+
/* patch */ static String _stringToSafeString(String string) {
14+
return JSON.encode(string);
15+
}
16+
1217
/* patch */ StackTrace get stackTrace => _stackTrace;
1318

1419
StackTrace _stackTrace;

sdk/lib/_internal/compiler/js_lib/core_patch.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:_interceptors';
88
import 'dart:_js_helper' show patch,
99
checkInt,
1010
getRuntimeType,
11+
jsonEncodeNative,
1112
JSSyntaxRegExp,
1213
Primitives,
1314
stringJoinUnchecked,
@@ -140,6 +141,11 @@ class Error {
140141
return Primitives.objectToString(object);
141142
}
142143

144+
@patch
145+
static String _stringToSafeString(String string) {
146+
return jsonEncodeNative(string);
147+
}
148+
143149
@patch
144150
StackTrace get stackTrace => Primitives.extractStackTrace(this);
145151
}

sdk/lib/_internal/compiler/js_lib/js_helper.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3238,6 +3238,10 @@ int random64() {
32383238
return int32a + int32b * 0x100000000;
32393239
}
32403240

3241+
String jsonEncodeNative(String string) {
3242+
return JS("String", "JSON.stringify(#)", string);
3243+
}
3244+
32413245
/**
32423246
* Returns a property name for placing data on JavaScript objects shared between
32433247
* DOM isolates. This happens when multiple programs are loaded in the same

sdk/lib/_internal/pub/test/build/copies_browser_js_next_to_entrypoints_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ main() {
3737
pubGet();
3838

3939
schedulePub(args: ["build", "foo", "web"],
40-
output: new RegExp(r'Built 16 files to "build".'));
40+
output: new RegExp(r'Built 12 files to "build".'));
4141

4242
d.dir(appPath, [
4343
d.dir('build', [

sdk/lib/_internal/pub/test/build/copies_browser_js_with_dependency_override_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ main() {
3636
pubGet();
3737

3838
schedulePub(args: ["build", "--all"],
39-
output: new RegExp(r'Built 4 files to "build".'));
39+
output: new RegExp(r'Built 3 files to "build".'));
4040

4141
d.dir(appPath, [
4242
d.dir('build', [

sdk/lib/_internal/pub/test/build/copies_browser_js_with_dev_dependency_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ main() {
3636
pubGet();
3737

3838
schedulePub(args: ["build", "--all"],
39-
output: new RegExp(r'Built 4 files to "build".'));
39+
output: new RegExp(r'Built 3 files to "build".'));
4040

4141
d.dir(appPath, [
4242
d.dir('build', [

sdk/lib/_internal/pub/test/build/outputs_results_to_json_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ main() {
2626
outputJson: {
2727
'buildResult': 'success',
2828
'outputDirectory': 'build',
29-
'numFiles': 2,
29+
'numFiles': 1,
3030
'log': [
3131
{
3232
'level': 'Info',

sdk/lib/_internal/pub/test/dart2js/compiles_entrypoints_in_root_package_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ main() {
4040
]).create();
4141

4242
schedulePub(args: ["build", "benchmark", "foo", "web"],
43-
output: new RegExp(r'Built 12 files to "build".'));
43+
output: new RegExp(r'Built 6 files to "build".'));
4444

4545
d.dir(appPath, [
4646
d.dir('build', [

sdk/lib/_internal/pub/test/dart2js/omits_source_map_in_release_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ main() {
1616
]).create();
1717

1818
schedulePub(args: ["build"],
19-
output: new RegExp(r'Built 2 files to "build".'),
19+
output: new RegExp(r'Built 1 file to "build".'),
2020
exitCode: 0);
2121

2222
d.dir(appPath, [

0 commit comments

Comments
 (0)