Initial compile time type check builtins

This commit is contained in:
dcodeIO
2018-03-17 12:54:37 +01:00
parent faac3c31eb
commit 2ed9fac171
15 changed files with 1158 additions and 657 deletions

View File

@ -148,3 +148,19 @@ String["fromCharCodes"] = function fromCharCodes(arr) {
String["fromCodePoints"] = function fromCodePoints(arr) {
return String.fromCodePoint.apply(String, arr);
};
globalScope["isInteger"] = Number.isInteger;
globalScope["isFloat"] = function isFloat(arg) {
return typeof arg === "number";
};
globalScope["isReference"] = function isClass(arg) {
return typeof arg === "object" || typeof arg === "string";
};
globalScope["isString"] = function isString(arg) {
return typeof arg === "string" || arg instanceof String;
};
globalScope["isArray"] = Array.isArray;