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

Unified Diff: src/js/regexp.js

Issue 2337763003: [regexp] Fix incorrect range checks in AtSurrogatePair (Closed)
Patch Set: Add testcase Created 4 years, 3 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/js/regexp.js
diff --git a/src/js/regexp.js b/src/js/regexp.js
index 8e27059bcc861047b1b2d377fb2a29c3e3473f59..b9b096492b754095d41056f72e82411e49376e13 100644
--- a/src/js/regexp.js
+++ b/src/js/regexp.js
@@ -296,7 +296,7 @@ function AtSurrogatePair(subject, index) {
var first = %_StringCharCodeAt(subject, index);
if (first < 0xD800 || first > 0xDBFF) return false;
var second = %_StringCharCodeAt(subject, index + 1);
- return second >= 0xDC00 || second <= 0xDFFF;
+ return second >= 0xDC00 && second <= 0xDFFF;
}
« 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