Home | History | Annotate | Download | only in src

Lines Matching refs:if

31   if (IS_STRING(this) && IS_STRING(y)) return %StringEquals(this, y);
35 if (IS_NUMBER(x)) {
37 if (IS_NUMBER(y)) return %NumberEquals(x, y);
38 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
39 if (IS_SYMBOL(y)) return 1; // not equal
40 if (!IS_SPEC_OBJECT(y)) {
46 } else if (IS_STRING(x)) {
48 if (IS_STRING(y)) return %StringEquals(x, y);
49 if (IS_SYMBOL(y)) return 1; // not equal
50 if (IS_NUMBER(y)) return %NumberEquals(%ToNumber(x), y);
51 if (IS_BOOLEAN(y)) return %NumberEquals(%ToNumber(x), %ToNumber(y));
52 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
55 } else if (IS_SYMBOL(x)) {
56 if (IS_SYMBOL(y)) return %_ObjectEquals(x, y) ? 0 : 1;
58 } else if (IS_BOOLEAN(x)) {
59 if (IS_BOOLEAN(y)) return %_ObjectEquals(x, y) ? 0 : 1;
60 if (IS_NULL_OR_UNDEFINED(y)) return 1;
61 if (IS_NUMBER(y)) return %NumberEquals(%ToNumber(x), y);
62 if (IS_STRING(y)) return %NumberEquals(%ToNumber(x), %ToNumber(y));
63 if (IS_SYMBOL(y)) return 1; // not equal
67 } else if (IS_NULL_OR_UNDEFINED(x)) {
71 if (IS_SPEC_OBJECT(y)) {
74 if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
75 if (IS_SYMBOL(y)) return 1; // not equal
76 if (IS_BOOLEAN(y)) y = %ToNumber(y);
84 if (IS_STRING(this)) {
85 if (!IS_STRING(x)) return 1; // not equal
89 if (IS_NUMBER(this)) {
90 if (!IS_NUMBER(x)) return 1; // not equal
94 // If anything else gets here, we just do simple identity check.
107 if (IS_STRING(this)) {
108 if (IS_STRING(x)) return %_StringCompare(this, x);
109 if (IS_UNDEFINED(x)) return ncr;
111 } else if (IS_NUMBER(this)) {
112 if (IS_NUMBER(x)) return %NumberCompare(this, x, ncr);
113 if (IS_UNDEFINED(x)) return ncr;
115 } else if (IS_UNDEFINED(this)) {
116 if (!IS_UNDEFINED(x)) {
120 } else if (IS_UNDEFINED(x)) {
128 if (IS_STRING(left) && IS_STRING(right)) {
133 if (NUMBER_IS_NAN(left_number) || NUMBER_IS_NAN(right_number)) return ncr;
148 if (IS_NUMBER(this) && IS_NUMBER(x)) return %NumberAdd(this, x);
149 if (IS_STRING(this) && IS_STRING(x)) return %_StringAdd(this, x);
155 if (IS_STRING(a)) {
157 } else if (IS_STRING(b)) {
167 if (!IS_STRING(y)) {
168 if (IS_STRING_WRAPPER(y) && %_IsStringWrapperSafeForDefaultValueOf(y)) {
183 if (!IS_STRING(x)) {
184 if (IS_STRING_WRAPPER(x) && %_IsStringWrapperSafeForDefaultValueOf(x)) {
199 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
207 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
215 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
223 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
237 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
245 if (IS_NUMBER(this)) {
247 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
254 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
258 if (NUMBER_IS_NAN(x)) return 0;
267 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
275 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
283 if (IS_NUMBER(this)) {
285 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
292 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
296 if (NUMBER_IS_NAN(x)) return 0;
305 if (!IS_NUMBER(y)) y = %NonNumberToNumber(y);
324 if (!IS_SPEC_OBJECT(x)) {
333 // efficient, the return value should be zero if the 'this' is an
334 // instance of F, and non-zero if not. This makes it possible to avoid
338 if (!IS_SPEC_FUNCTION(F)) {
342 // If V is not an object, return false.
343 if (!IS_SPEC_OBJECT(V)) {
347 // Check if function is bound, if so, get [[BoundFunction]] from it
350 if (bindings) {
353 // Get the prototype of F; if it is not an object, throw an error.
355 if (!IS_SPEC_OBJECT(O)) {
364 // Filter a given key against an object by checking if the object
365 // has a property with the given key; return the key as a string if
369 if (%HasProperty(this, string)) return string;
376 if (!IS_FUNCTION(delegate)) {
385 if (!IS_FUNCTION(delegate)) {
410 // array. This is the fast case. If this fails, we do the slow case
412 if (IS_ARRAY(args)) {
414 if (%_IsSmi(length) && length >= 0 && length < 0x800000 &&
422 // We can handle any number of apply arguments if the stack is
425 if (length > 0x800000) {
429 if (!IS_SPEC_FUNCTION(this)) {
435 if (args != null && !IS_SPEC_OBJECT(args)) {
477 if (IS_STRING(x)) return x;
479 if (!IS_SPEC_OBJECT(x)) return x;
480 if (IS_SYMBOL_WRAPPER(x)) throw MakeTypeError('symbol_to_primitive', []);
481 if (hint == NO_HINT) hint = (IS_DATE(x)) ? STRING_HINT : NUMBER_HINT;
488 if (IS_BOOLEAN(x)) return x;
489 if (IS_STRING(x)) return x.length != 0;
490 if (x == null) return false;
491 if (IS_NUMBER(x)) return !((x == 0) || NUMBER_IS_NAN(x));
498 if (IS_NUMBER(x)) return x;
499 if (IS_STRING(x)) {
503 if (IS_BOOLEAN(x)) return x ? 1 : 0;
504 if (IS_UNDEFINED(x)) return NAN;
505 if (IS_SYMBOL(x)) throw MakeTypeError('symbol_to_number', []);
510 if (IS_STRING(x)) {
514 if (IS_BOOLEAN(x)) return x ? 1 : 0;
515 if (IS_UNDEFINED(x)) return NAN;
516 if (IS_SYMBOL(x)) throw MakeTypeError('symbol_to_number', []);
523 if (IS_STRING(x)) return x;
524 if (IS_NUMBER(x)) return %_NumberToString(x);
525 if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
526 if (IS_UNDEFINED(x)) return 'undefined';
527 if (IS_SYMBOL(x)) throw %MakeTypeError('symbol_to_string', []);
532 if (IS_NUMBER(x)) return %_NumberToString(x);
533 if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
534 if (IS_UNDEFINED(x)) return 'undefined';
535 if (IS_SYMBOL(x)) throw %MakeTypeError('symbol_to_string', []);
548 if (IS_STRING(x)) return new $String(x);
549 if (IS_NUMBER(x)) return new $Number(x);
550 if (IS_BOOLEAN(x)) return new $Boolean(x);
551 if (IS_SYMBOL(x)) return %NewSymbolWrapper(x);
552 if (IS_NULL_OR_UNDEFINED(x) && !IS_UNDETECTABLE(x)) {
561 if (%_IsSmi(x)) return x;
569 if (arg < 0) return 0;
576 if (%_IsSmi(x) && x >= 0) return x;
583 if (%_IsSmi(x)) return x;
590 if (typeof x != typeof y) return false;
591 if (IS_NUMBER(x)) {
592 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
594 if (x === 0 && y === 0 && %_IsMinusZero(x) != %_IsMinusZero(y)) {
607 // Returns if the given x is a primitive value - not an object or a
612 // (i.e., it will return false if x is null).
619 if (!IS_SYMBOL_WRAPPER(x)) {
621 if (IS_SPEC_FUNCTION(valueOf)) {
623 if (%IsPrimitive(v)) return v;
627 if (IS_SPEC_FUNCTION(toString)) {
629 if (%IsPrimitive(s)) return s;
637 if (!IS_SYMBOL_WRAPPER(x)) {
639 if (IS_SPEC_FUNCTION(toString)) {
641 if (%IsPrimitive(s)) return s;
645 if (IS_SPEC_FUNCTION(valueOf)) {
647 if (%IsPrimitive(v)) return v;
655 if (i < 0) throw MakeRangeError(rangeErrorName);