Reviewers: Yang,

Description:
[runtime] Simplify CHECK_OBJECT_COERCIBLE.

Don't use IS_NULL_OR_UNDEFINED() for CHECK_OBJECT_COERCIBLE() because it
will also return true for undetectable objects, but use IS_NULL() and
IS_UNDEFINED() directly, which will only return true for null or
undefined (which matches the semantics of the abstract operation
CheckObjectCoercible).

[email protected]

Please review this at https://codereview.chromium.org/1287033002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+1, -1 lines):
  M src/macros.py


Index: src/macros.py
diff --git a/src/macros.py b/src/macros.py
index 124b1e7fba9814f07d87ec83c57556bb8770998f..ee0770bd90068d8cbd9a5a44c0507bb920b4af00 100644
--- a/src/macros.py
+++ b/src/macros.py
@@ -136,7 +136,7 @@ macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function');

 # Macro for ES6 CheckObjectCoercible
# Will throw a TypeError of the form "[functionName] called on null or undefined". -macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg) && !IS_UNDETECTABLE(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, functionName); +macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || IS_UNDEFINED(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, functionName);

# Indices in bound function info retrieved by %BoundFunctionGetBindings(...).
 define kBoundFunctionIndex = 0;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to