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

Issue 8763018: Fix NamingTest on all Frog configurations (Closed)

Created:
9 years ago by Jennifer Messerly
Modified:
9 years ago
Reviewers:
jimhug
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix NamingTest on all Frog configurations: * throw the right exception even if the missing method was call$1 * fix a nasty escape bug in replaceAll ($ is a meta-char in the second argument of String.prototype.replace, so it must be escaped as "$$"). This bug is especially meta because the code that failed was str.replaceAll("$", "$$") ... but the bug could be triggered any time the "to" argument to "replaceAll" contained "$". See this link for more info: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace Committed: https://code.google.com/p/dart/source/detail?r=1966

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -268 lines) Patch
M frog/frogsh View 89 chunks +265 lines, -262 lines 0 comments Download
M frog/lib/natives.dart View 1 chunk +3 lines, -1 line 0 comments Download
M frog/lib/string_implementation.dart View 1 chunk +1 line, -0 lines 1 comment Download
M tests/language/language.status View 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Jennifer Messerly
tbr
9 years ago (2011-12-01 03:59:02 UTC) #1
jimhug
9 years ago (2011-12-14 22:14:47 UTC) #2
lgtm

Well, actually this looks pretty awful to me - but that's the fault of the crazy
escaping rules we get to deal with and not your code.

http://codereview.chromium.org/8763018/diff/1/frog/lib/string_implementation....
File frog/lib/string_implementation.dart (right):

http://codereview.chromium.org/8763018/diff/1/frog/lib/string_implementation....
frog/lib/string_implementation.dart:51: to = to.replace(/\$/g, '$$$$'); //
Escape sequences are fun!
I wanted to suggest that you use @'$$' to simplify this - but the I realized you
were in JS <smile>.

Powered by Google App Engine
This is Rietveld 408576698