mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-18 15:59:24 +02:00
rtl: added JSDelete
This commit is contained in:
parent
d8e91fc412
commit
8bda483894
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<Version Value="11"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
@ -20,9 +20,10 @@
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
@ -45,6 +46,18 @@
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<AllowLabel Value="False"/>
|
||||
<CPPInline Value="False"/>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
<ExecuteBefore>
|
||||
<Command Value="$MakeExe(pas2js) -Jirtl.js -Tnodejs -Fu$(ProjUnitPath) -o$NameOnly($(ProjFile)).js $Name($(ProjFile))"/>
|
||||
|
@ -1,6 +1,6 @@
|
||||
program demodatetime;
|
||||
|
||||
uses sysutils;
|
||||
uses sysutils, js;
|
||||
|
||||
Procedure DumpDate(Msg : String; Dt : TDateTime);
|
||||
|
||||
|
@ -731,6 +731,7 @@ var
|
||||
JSExceptValue: JSValue; external name '$e';
|
||||
|
||||
Function new(aElements: TJSValueDynArray) : TJSObject; overload;
|
||||
function JSDelete(const Obj: JSValue; const PropName: string): boolean; assembler; overload;
|
||||
|
||||
function decodeURIComponent(encodedURI : String) : String; external name 'decodeURIComponent';
|
||||
function encodeURIComponent(str : String) : String; external name 'encodeURIComponent';
|
||||
@ -780,7 +781,7 @@ Var
|
||||
|
||||
implementation
|
||||
|
||||
Function new(aElements: TJSValueDynArray) : TJSObject;
|
||||
function new(aElements: TJSValueDynArray): TJSObject;
|
||||
|
||||
function toString(I : Integer): string; external name 'String';
|
||||
|
||||
@ -813,6 +814,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function JSDelete(const Obj: JSValue; const PropName: string): boolean; assembler;
|
||||
asm
|
||||
return delete Obj[PropName];
|
||||
end;
|
||||
|
||||
function hasValue(const v: JSValue): boolean; assembler;
|
||||
asm
|
||||
if(v){ return true; } else { return false; };
|
||||
@ -948,7 +954,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
Function GetValueType(JS : JSValue) : TJSValueType;
|
||||
function GetValueType(JS: JSValue): TJSValueType;
|
||||
|
||||
Var
|
||||
t : string;
|
||||
|
Loading…
Reference in New Issue
Block a user