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

Unified Diff: src/string.js

Issue 1123353004: Revert of Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/runtime.js ('k') | src/string-iterator.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 a9cf8669fbd723022de5cc6a6217391c9709d8a6..85d8dbc192250a36307ec8f1c01c03b385ea312b 100644
--- a/src/string.js
+++ b/src/string.js
@@ -113,7 +113,7 @@
var patLength = pat.length;
var index = subLength - patLength;
if (%_ArgumentsLength() > 1) {
- var position = $toNumber(%_Arguments(1));
+ var position = ToNumber(%_Arguments(1));
if (!NUMBER_IS_NAN(position)) {
position = TO_INTEGER(position);
if (position < 0) {
@@ -803,7 +803,7 @@
function StringFromCharCode(code) {
var n = %_ArgumentsLength();
if (n == 1) {
- if (!%_IsSmi(code)) code = $toNumber(code);
+ if (!%_IsSmi(code)) code = ToNumber(code);
return %_StringCharFromCode(code & 0xffff);
}
@@ -811,7 +811,7 @@
var i;
for (i = 0; i < n; i++) {
var code = %_Arguments(i);
- if (!%_IsSmi(code)) code = $toNumber(code) & 0xffff;
+ if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff;
if (code < 0) code = code & 0xffff;
if (code > 0xff) break;
%_OneByteSeqStringSetChar(i, code, one_byte);
@@ -822,7 +822,7 @@
var two_byte = %NewString(n - i, NEW_TWO_BYTE_STRING);
for (var j = 0; i < n; i++, j++) {
var code = %_Arguments(i);
- if (!%_IsSmi(code)) code = $toNumber(code) & 0xffff;
+ if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff;
%_TwoByteSeqStringSetChar(j, code, two_byte);
}
return one_byte + two_byte;
@@ -930,7 +930,7 @@
CHECK_OBJECT_COERCIBLE(this, "String.prototype.repeat");
var s = TO_STRING_INLINE(this);
- var n = $toInteger(count);
+ var n = ToInteger(count);
// The maximum string length is stored in a smi, so a longer repeat
// must result in a range error.
if (n < 0 || n > %_MaxSmi()) throw MakeRangeError(kInvalidCountValue);
@@ -959,7 +959,7 @@
var pos = 0;
if (%_ArgumentsLength() > 1) {
pos = %_Arguments(1); // position
- pos = $toInteger(pos);
+ pos = ToInteger(pos);
}
var s_len = s.length;
@@ -989,7 +989,7 @@
if (%_ArgumentsLength() > 1) {
var arg = %_Arguments(1); // position
if (!IS_UNDEFINED(arg)) {
- pos = $toInteger(arg);
+ pos = ToInteger(arg);
}
}
@@ -1018,7 +1018,7 @@
var pos = 0;
if (%_ArgumentsLength() > 1) {
pos = %_Arguments(1); // position
- pos = $toInteger(pos);
+ pos = ToInteger(pos);
}
var s_len = s.length;
@@ -1063,7 +1063,7 @@
for (index = 0; index < length; index++) {
code = %_Arguments(index);
if (!%_IsSmi(code)) {
- code = $toNumber(code);
+ code = ToNumber(code);
}
if (code < 0 || code > 0x10FFFF || code !== TO_INTEGER(code)) {
throw MakeRangeError(kInvalidCodePoint, code);
@@ -1087,18 +1087,18 @@
function StringRaw(callSite) {
// TODO(caitp): Use rest parameters when implemented
var numberOfSubstitutions = %_ArgumentsLength();
- var cooked = $toObject(callSite);
- var raw = $toObject(cooked.raw);
- var literalSegments = $toLength(raw.length);
+ var cooked = ToObject(callSite);
+ var raw = ToObject(cooked.raw);
+ var literalSegments = ToLength(raw.length);
if (literalSegments <= 0) return "";
- var result = $toString(raw[0]);
+ var result = ToString(raw[0]);
for (var i = 1; i < literalSegments; ++i) {
if (i < numberOfSubstitutions) {
- result += $toString(%_Arguments(i));
- }
- result += $toString(raw[i]);
+ result += ToString(%_Arguments(i));
+ }
+ result += ToString(raw[i]);
}
return result;
« no previous file with comments | « src/runtime.js ('k') | src/string-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698