Home | History | Annotate | Download | only in src

Lines Matching refs:if

26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 if (IS_STRING(this) && IS_STRING(y)) return %StringEquals(this, y);
59 if (IS_NUMBER(x)) {
61 if (IS_NUMBER(y)) return %NumberEquals(x, y);
62 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
63 if (!IS_SPEC_OBJECT(y)) {
69 } else if (IS_STRING(x)) {
71 if (IS_STRING(y)) return %StringEquals(x, y);
72 if (IS_NUMBER(y)) return %NumberEquals(%ToNumber(x), y);
73 if (IS_BOOLEAN(y)) return %NumberEquals(%ToNumber(x), %ToNumber(y));
74 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
77 } else if (IS_BOOLEAN(x)) {
78 if (IS_BOOLEAN(y)) return %_ObjectEquals(x, y) ? 0 : 1;
79 if (IS_NULL_OR_UNDEFINED(y)) return 1;
80 if (IS_NUMBER(y)) return %NumberEquals(%ToNumber(x), y);
81 if (IS_STRING(y)) return %NumberEquals(%ToNumber(x), %ToNumber(y));
85 } else if (IS_NULL_OR_UNDEFINED(x)) {
89 if (IS_SPEC_OBJECT(y)) {
92 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
93 if (IS_BOOLEAN(y)) y = %ToNumber(y);
101 if (IS_STRING(this)) {
102 if (!IS_STRING(x)) return 1; // not equal
106 if (IS_NUMBER(this)) {
107 if (!IS_NUMBER(x)) return 1; // not equal
111 // If anything else gets here, we just do simple identity check.
124 if (IS_STRING(this)) {
125 if (IS_STRING(x)) return %_StringCompare(this, x);
126 if (IS_UNDEFINED(x)) return ncr;
128 } else if (IS_NUMBER(this)) {
129 if (IS_NUMBER(x)) return %NumberCompare(this, x, ncr);
130 if (IS_UNDEFINED(x)) return ncr;
132 } else if (IS_UNDEFINED(this)) {
133 if (!IS_UNDEFINED(x)) {
137 } else if (IS_UNDEFINED(x)) {
145 if (IS_STRING(left) && IS_STRING(right)) {
150 if (NUMBER_IS_NAN(left_number) || NUMBER_IS_NAN(right_number)) return ncr;
165 if (IS_NUMBER(this) && IS_NUMBER(x)) return %NumberAdd(this, x);
166 if (IS_STRING(this) && IS_STRING(x)) return %_StringAdd(this, x);
172 if (IS_STRING(a)) {
174 } else if (IS_STRING(b)) {
184 if (!IS_STRING(y)) {
185 if (IS_STRING_WRAPPER(y) && %_IsStringWrapperSafeForDefaultValueOf(y)) {
200 if (!IS_STRING(x)) {
201 if (IS_STRING_WRAPPER(x) && %_IsStringWrapperSafeForDefaultValueOf(x)) {
216 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
224 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
232 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
240 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
254 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
262 if (IS_NUMBER(this)) {
264 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
271 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
275 if (NUMBER_IS_NAN(x)) return 0;
284 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
306 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
314 if (IS_NUMBER(this)) {
316 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
323 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
327 if (NUMBER_IS_NAN(x)) return 0;
336 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
355 if (!IS_SPEC_OBJECT(x)) {
364 // efficient, the return value should be zero if the 'this' is an
365 // instance of F, and non-zero if not. This makes it possible to avoid
369 if (!IS_SPEC_FUNCTION(F)) {
373 // If V is not an object, return false.
374 if (!IS_SPEC_OBJECT(V)) {
378 // Check if function is bound, if so, get [[BoundFunction]] from it
381 if (bindings) {
384 // Get the prototype of F; if it is not an object, throw an error.
386 if (!IS_SPEC_OBJECT(O)) {
395 // Filter a given key against an object by checking if the object
396 // has a property with the given key; return the key as a string if
400 if (%HasProperty(this, string)) return string;
407 if (!IS_FUNCTION(delegate)) {
416 if (!IS_FUNCTION(delegate)) {
441 // array. This is the fast case. If this fails, we do the slow case
443 if (IS_ARRAY(args)) {
445 if (%_IsSmi(length) && length >= 0 && length < 0x800000 &&
453 // We can handle any number of apply arguments if the stack is
456 if (length > 0x800000) {
460 if (!IS_SPEC_FUNCTION(this)) {
466 if (args != null && !IS_SPEC_OBJECT(args)) {
508 if (IS_STRING(x)) return x;
510 if (!IS_SPEC_OBJECT(x)) return x;
511 if (hint == NO_HINT) hint = (IS_DATE(x)) ? STRING_HINT : NUMBER_HINT;
518 if (IS_BOOLEAN(x)) return x;
519 if (IS_STRING(x)) return x.length != 0;
520 if (x == null) return false;
521 if (IS_NUMBER(x)) return !((x == 0) || NUMBER_IS_NAN(x));
528 if (IS_NUMBER(x)) return x;
529 if (IS_STRING(x)) {
533 if (IS_BOOLEAN(x)) return x ? 1 : 0;
534 if (IS_UNDEFINED(x)) return $NaN;
539 if (IS_STRING(x)) {
543 if (IS_BOOLEAN(x)) return x ? 1 : 0;
544 if (IS_UNDEFINED(x)) return $NaN;
551 if (IS_STRING(x)) return x;
552 if (IS_NUMBER(x)) return %_NumberToString(x);
553 if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
554 if (IS_UNDEFINED(x)) return 'undefined';
559 if (IS_NUMBER(x)) return %_NumberToString(x);
560 if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
561 if (IS_UNDEFINED(x)) return 'undefined';
568 if (IS_STRING(x)) return new $String(x);
569 if (IS_NUMBER(x)) return new $Number(x);
570 if (IS_BOOLEAN(x)) return new $Boolean(x);
571 if (IS_NULL_OR_UNDEFINED(x) && !IS_UNDETECTABLE(x)) {
580 if (%_IsSmi(x)) return x;
587 if (%_IsSmi(x) && x >= 0) return x;
594 if (%_IsSmi(x)) return x;
601 if (typeof x != typeof y) return false;
602 if (IS_NUMBER(x)) {
603 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
605 if (x === 0 && y === 0 && (1 / x) != (1 / y)) return false;
616 // Returns if the given x is a primitive value - not an object or a
621 // (i.e., it will return false if x is null).
629 if (IS_SPEC_FUNCTION(valueOf)) {
631 if (%IsPrimitive(v)) return v;
635 if (IS_SPEC_FUNCTION(toString)) {
637 if (%IsPrimitive(s)) return s;
647 if (IS_SPEC_FUNCTION(toString)) {
649 if (%IsPrimitive(s)) return s;
653 if (IS_SPEC_FUNCTION(valueOf)) {
655 if (%IsPrimitive(v)) return v;