Rrraaa, I have to say, doing program rewriting via regexp rules is an inherently broken idea...
R=mstarzinger@chromium.org
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/
9644001
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10969
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// Harmony egal.
function ObjectIs(obj1, obj2) {
if (obj1 === obj2) {
- return (obj1 !== 0) || ((1 / obj1) === (1 / obj2));
+ return (obj1 !== 0) || (1 / obj1 === 1 / obj2);
} else {
return (obj1 !== obj1) && (obj2 !== obj2);
}
assertSame(expected, Object.is(x, y));
}
-var test_set = [ {}, [], 1/0, -1/0, "s", 0, 1/(-1/0), null, undefined ];
+var test_set = [ {}, [], 1/0, -1/0, "s", 0, 0/-1, null, undefined ];
print(test_set);
for (var i = 0; i < test_set.length; i++) {
for (var j = 0; j < test_set.length; j++) {
# A regexp that matches a regexp literal surrounded by /slashes/.
# Don't allow a regexp to have a ) before the first ( since that's a
# syntax error and it's probably just two unrelated slashes.
- slash_quoted_regexp = r"/(?:(?=\()|(?:[^()/\\]|\\.)+)(?:\([^/\\]|\\.)*/"
+ # Also don't allow it to come after anything that can only be the
+ # end of a primary expression.
+ slash_quoted_regexp = r"(?<![\w$'\")\]])/(?:(?=\()|(?:[^()/\\]|\\.)+)(?:\([^/\\]|\\.)*/"
# Replace multiple spaces with a single space.
line = re.sub("|".join([double_quoted_string,
single_quoted_string,