mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixing typeof for boolean arguments.
This commit is contained in:
parent
49d990ad32
commit
e8d728f8ce
@ -1464,13 +1464,9 @@ opfunc_typeof (opcode_t opdata, /**< operation data */
|
||||
break;
|
||||
}
|
||||
case ECMA_SIMPLE_VALUE_FALSE:
|
||||
{
|
||||
type_str_p = ecma_get_magic_string (ECMA_MAGIC_STRING_FALSE);
|
||||
break;
|
||||
}
|
||||
case ECMA_SIMPLE_VALUE_TRUE:
|
||||
{
|
||||
type_str_p = ecma_get_magic_string (ECMA_MAGIC_STRING_TRUE);
|
||||
type_str_p = ecma_get_magic_string (ECMA_MAGIC_STRING_BOOLEAN);
|
||||
break;
|
||||
}
|
||||
case ECMA_SIMPLE_VALUE_EMPTY:
|
||||
|
||||
@ -647,6 +647,7 @@ typedef enum
|
||||
ECMA_MAGIC_STRING_NULL, /**< "null" */
|
||||
ECMA_MAGIC_STRING_FALSE, /**< "false" */
|
||||
ECMA_MAGIC_STRING_TRUE, /**< "true" */
|
||||
ECMA_MAGIC_STRING_BOOLEAN, /**< "boolean" */
|
||||
ECMA_MAGIC_STRING_NUMBER, /**< "number" */
|
||||
ECMA_MAGIC_STRING_STRING, /**< "string" */
|
||||
ECMA_MAGIC_STRING_OBJECT, /**< "object" */
|
||||
|
||||
@ -1284,6 +1284,7 @@ ecma_get_magic_string_zt (ecma_magic_string_id_t id) /**< magic string id */
|
||||
case ECMA_MAGIC_STRING_NULL: return (ecma_char_t*) "null";
|
||||
case ECMA_MAGIC_STRING_FALSE: return (ecma_char_t*) "false";
|
||||
case ECMA_MAGIC_STRING_TRUE: return (ecma_char_t*) "true";
|
||||
case ECMA_MAGIC_STRING_BOOLEAN: return (ecma_char_t*) "boolean";
|
||||
case ECMA_MAGIC_STRING_NUMBER: return (ecma_char_t*) "number";
|
||||
case ECMA_MAGIC_STRING_STRING: return (ecma_char_t*) "string";
|
||||
case ECMA_MAGIC_STRING_OBJECT: return (ecma_char_t*) "object";
|
||||
|
||||
@ -19,8 +19,8 @@ function f()
|
||||
|
||||
assert(typeof(a) === "undefined");
|
||||
assert(typeof(null) === "object");
|
||||
assert(typeof(false) === "false");
|
||||
assert(typeof(true) === "true");
|
||||
assert(typeof(false) === "boolean");
|
||||
assert(typeof(true) === "boolean");
|
||||
assert(typeof(1) === "number");
|
||||
assert(typeof(1.1) === "number");
|
||||
assert(typeof('abcd') === "string");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user