mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 10:41:42 +00:00
Initial compile time type check builtins
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user