Revision f230a1cf deps/v8/src/string.js
deps/v8/src/string.js | ||
---|---|---|
28 | 28 |
// This file relies on the fact that the following declaration has been made |
29 | 29 |
// in runtime.js: |
30 | 30 |
// var $String = global.String; |
31 |
// var $NaN = 0/0; |
|
32 | 31 |
|
33 | 32 |
// ------------------------------------------------------------------- |
34 | 33 |
|
... | ... | |
574 | 573 |
var s_len = s.length; |
575 | 574 |
var start_i = TO_INTEGER(start); |
576 | 575 |
var end_i = s_len; |
577 |
if (end !== void 0) {
|
|
576 |
if (!IS_UNDEFINED(end)) {
|
|
578 | 577 |
end_i = TO_INTEGER(end); |
579 | 578 |
} |
580 | 579 |
|
... | ... | |
699 | 698 |
%_CallFunction(result, %_SubString(subject, start, end), |
700 | 699 |
ArrayPushBuiltin); |
701 | 700 |
} else { |
702 |
%_CallFunction(result, void 0, ArrayPushBuiltin);
|
|
701 |
%_CallFunction(result, UNDEFINED, ArrayPushBuiltin);
|
|
703 | 702 |
} |
704 | 703 |
if (result.length === limit) break outer_loop; |
705 | 704 |
} |
... | ... | |
756 | 755 |
|
757 | 756 |
// Correct n: If not given, set to string length; if explicitly |
758 | 757 |
// set to undefined, zero, or negative, returns empty string. |
759 |
if (n === void 0) {
|
|
758 |
if (IS_UNDEFINED(n)) {
|
|
760 | 759 |
len = s.length; |
761 | 760 |
} else { |
762 | 761 |
len = TO_INTEGER(n); |
... | ... | |
765 | 764 |
|
766 | 765 |
// Correct start: If not given (or undefined), set to zero; otherwise |
767 | 766 |
// convert to integer and handle negative case. |
768 |
if (start === void 0) {
|
|
767 |
if (IS_UNDEFINED(start)) {
|
|
769 | 768 |
start = 0; |
770 | 769 |
} else { |
771 | 770 |
start = TO_INTEGER(start); |
Also available in: Unified diff