| Index: src/runtime.js
|
| diff --git a/src/runtime.js b/src/runtime.js
|
| index 5e73d4100d643e35aadda8cbd9ab4ed1c62d541a..030aedb0a8f2877ab7f8a93c03659211b5db4037 100644
|
| --- a/src/runtime.js
|
| +++ b/src/runtime.js
|
| @@ -163,6 +163,20 @@ function ADD(x) {
|
| }
|
|
|
|
|
| +// Left operand (this) is already a string.
|
| +function STRING_ADD_LEFT(x) {
|
| + x = %ToString(%ToPrimitive(x, NO_HINT));
|
| + return %StringAdd(this, x);
|
| +}
|
| +
|
| +
|
| +// Right operand (x) is already a string.
|
| +function STRING_ADD_RIGHT(x) {
|
| + var a = %ToString(%ToPrimitive(this, NO_HINT));
|
| + return %StringAdd(a, x);
|
| +}
|
| +
|
| +
|
| // ECMA-262, section 11.6.2, page 50.
|
| function SUB(x) {
|
| return %NumberSub(%ToNumber(this), %ToNumber(x));
|
| @@ -275,7 +289,7 @@ function IN(x) {
|
|
|
|
|
| // ECMA-262, section 11.8.6, page 54. To make the implementation more
|
| -// efficient, the return value should be zero if the 'this' is an
|
| +// efficient, the return value should be zero if the 'this' is an
|
| // instance of F, and non-zero if not. This makes it possible to avoid
|
| // an expensive ToBoolean conversion in the generated code.
|
| function INSTANCE_OF(F) {
|
|
|