Skip to content

Commit

Permalink
Merge r174260 - Change how 32-bit JSValues check if they are a Boolean
Browse files Browse the repository at this point in the history
Rubber stamped by Filip Pizlo.

32-bit JSValue::isBoolean can simply check if its tag corresponds
to the boolean tag instead of checking if it's either true or false.

* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isBoolean):

Canonical link: https://commits.webkit.org/154760.101@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
saambarati authored and carlosgcampos committed Oct 21, 2014
1 parent f2cd462 commit ed4d832
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
2014-10-03 Saam Barati <saambarati1@gmail.com>

Change how 32-bit JSValues check if they are a Boolean

Rubber stamped by Filip Pizlo.

32-bit JSValue::isBoolean can simply check if its tag corresponds
to the boolean tag instead of checking if it's either true or false.

* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isBoolean):

2014-10-01 Anders Carlsson <andersca@apple.com>

Use variadic templates for jsMakeNontrivialString
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/JSCJSValueInlines.h
Expand Up @@ -327,7 +327,7 @@ inline bool JSValue::isNumber() const

inline bool JSValue::isBoolean() const
{
return isTrue() || isFalse();
return tag() == BooleanTag;
}

inline bool JSValue::asBoolean() const
Expand Down

0 comments on commit ed4d832

Please sign in to comment.