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

Unified Diff: frog/frogsh

Side-by-side diff isn't available for this file because of its large size.
Issue 8773021: Fixed escaping of const values (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: safer escaping Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | frog/value.dart » ('j') | frog/value.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index a8a3d9bbb993607052c41a8d1184f52a5ee1b125..dd93a82b24f994935730b2561c5434ed30c3d4a0 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -23749,7 +23749,7 @@ EvaluatedValue.prototype.get$isConst = function() {
EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalCode; };
EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canonicalCode = value; };
EvaluatedValue.codeWithComments = function(canonicalCode, span) {
- return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCode + '/*' + span.get$text() + '*/') : canonicalCode;
+ return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCode + '/*' + _escapeForComment(span.get$text()) + '*/') : canonicalCode;
}
// ********** Code for ConstListValue **************
function ConstListValue() {}
@@ -23840,7 +23840,7 @@ GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies) {
var $0;
var name = ("const\$" + uniqueId);
- var codeWithComment = ("" + name + "/*" + exp.span.get$text() + "*/");
+ var codeWithComment = ("" + name + "/*" + _escapeForComment(exp.span.get$text()) + "*/");
return new GlobalValue(exp.type, $assert_String(codeWithComment), true, null, name, exp, name, exp.span, (($0 = dependencies.filter$1((function (d) {
return (d instanceof GlobalValue);
})
@@ -24678,6 +24678,9 @@ function stripLeadingNewline(text) {
return text;
}
}
+function _escapeForComment(text) {
+ return text.replaceAll('/*', '/ *').replaceAll('*/', '* /');
+}
var world;
var experimentalAwaitPhase;
function initializeWorld(files) {
« no previous file with comments | « no previous file | frog/value.dart » ('j') | frog/value.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698