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

Unified Diff: src/string.js

Issue 11576069: Correctly handle negative codes in String.fromCharCode() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-166553.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index badfad353603a9ae2214f806e0cd30911c297521..d9ca035fb5f32983d34bc970fa24867f0acce268 100644
--- a/src/string.js
+++ b/src/string.js
@@ -824,6 +824,7 @@ function StringFromCharCode(code) {
for (i = 0; i < n; i++) {
var code = %_Arguments(i);
if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff;
+ if (code < 0) code = code & 0xffff;
if (code > 0x7f) break;
%_OneByteSeqStringSetChar(one_byte, i, code);
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-166553.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698