mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-06-22 18:08:13 +02:00
* Add IsDate
This commit is contained in:
parent
949f0181b9
commit
cc0cee2387
@ -856,6 +856,7 @@ function hasString(const v: JSValue): boolean; external name 'rtl.hasString';//
|
|||||||
function hasValue(const v: JSValue): boolean; assembler; // returns the JS definition of if(v): v is not false, undefined, null, 0, NaN, or the empty string. Note: JS if(new Boolean(false)) returns true.
|
function hasValue(const v: JSValue): boolean; assembler; // returns the JS definition of if(v): v is not false, undefined, null, 0, NaN, or the empty string. Note: JS if(new Boolean(false)) returns true.
|
||||||
function isArray(const v: JSValue): boolean; external name 'rtl.isArray';
|
function isArray(const v: JSValue): boolean; external name 'rtl.isArray';
|
||||||
function isBoolean(const v: JSValue): boolean; assembler;
|
function isBoolean(const v: JSValue): boolean; assembler;
|
||||||
|
function isDate(const v: JSValue): boolean; assembler;
|
||||||
function isCallback(const v: JSValue): boolean; assembler;
|
function isCallback(const v: JSValue): boolean; assembler;
|
||||||
function isChar(const v: JSValue): boolean; assembler;
|
function isChar(const v: JSValue): boolean; assembler;
|
||||||
function isClass(const v: JSValue): boolean; assembler; // is a Pascal class, e.g. a TClass
|
function isClass(const v: JSValue): boolean; assembler; // is a Pascal class, e.g. a TClass
|
||||||
@ -941,6 +942,11 @@ asm
|
|||||||
return typeof(v) == 'boolean';
|
return typeof(v) == 'boolean';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function isDate(const v: JSValue): boolean; assembler;
|
||||||
|
asm
|
||||||
|
return (v instanceof Date);
|
||||||
|
end;
|
||||||
|
|
||||||
function isCallback(const v: JSValue): boolean; assembler;
|
function isCallback(const v: JSValue): boolean; assembler;
|
||||||
asm
|
asm
|
||||||
return rtl.isObject(v) && rtl.isObject(v.scope) && (rtl.isString(v.fn) || rtl.isFunction(v.fn));
|
return rtl.isObject(v) && rtl.isObject(v.scope) && (rtl.isString(v.fn) || rtl.isFunction(v.fn));
|
||||||
|
Loading…
Reference in New Issue
Block a user