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

Unified Diff: src/jsregexp.cc

Issue 1745017: Port regexp fix (backslash-b at end of input) to (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regexp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 4511)
+++ src/jsregexp.cc (working copy)
@@ -4870,17 +4870,18 @@
SetRelation word_relation =
CharacterRange::WordCharacterRelation(following_chars);
- if (word_relation.ContainedIn()) {
- // Following character is definitely a word character.
+ if (word_relation.Disjoint()) {
+ // Includes the case where following_chars is empty (e.g., end-of-input).
+ // Following character is definitely *not* a word character.
type = (type == AssertionNode::AT_BOUNDARY) ?
- AssertionNode::AFTER_NONWORD_CHARACTER :
- AssertionNode::AFTER_WORD_CHARACTER;
+ AssertionNode::AFTER_WORD_CHARACTER :
+ AssertionNode::AFTER_NONWORD_CHARACTER;
that->set_type(type);
- } else if (word_relation.Disjoint()) {
- // Following character is definitely *not* a word character.
+ } else if (word_relation.ContainedIn()) {
+ // Following character is definitely a word character.
type = (type == AssertionNode::AT_BOUNDARY) ?
- AssertionNode::AFTER_WORD_CHARACTER :
- AssertionNode::AFTER_NONWORD_CHARACTER;
+ AssertionNode::AFTER_NONWORD_CHARACTER :
+ AssertionNode::AFTER_WORD_CHARACTER;
that->set_type(type);
}
}
« no previous file with comments | « no previous file | test/mjsunit/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698