mirror of https://github.com/tc39/test262.git
[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 2b233fa3c0 on Sat Dec 15 2018 19:14:38 GMT+0000 (Coordinated Universal Time)
This commit is contained in:
parent
bf6b753dd7
commit
18bf7976f5
|
@ -0,0 +1,34 @@
|
|||
//@ runBigIntEnabled
|
||||
|
||||
function assert(a) {
|
||||
if (!a)
|
||||
throw new Error("Bad assertion");
|
||||
}
|
||||
|
||||
assert(typeof 0n === "bigint");
|
||||
assert(typeof 1n !== "object");
|
||||
|
||||
function typeOf(value)
|
||||
{
|
||||
return typeof value;
|
||||
}
|
||||
noInline(typeOf);
|
||||
|
||||
var object = {};
|
||||
var func = function () { };
|
||||
var bigInt = 1n;
|
||||
var number = 0;
|
||||
var string = "String";
|
||||
var symbol = Symbol("Symbol");
|
||||
|
||||
for (var i = 0; i < 1e6; ++i) {
|
||||
assert(typeOf(object) === "object");
|
||||
assert(typeOf(func) === "function");
|
||||
assert(typeOf(bigInt) === "bigint");
|
||||
assert(typeOf(number) === "number");
|
||||
assert(typeOf(string) === "string");
|
||||
assert(typeOf(symbol) === "symbol");
|
||||
assert(typeOf(null) === "object");
|
||||
assert(typeOf(undefined) === "undefined");
|
||||
assert(typeOf(true) === "boolean");
|
||||
}
|
Loading…
Reference in New Issue