@@ -447,11 +447,11 @@ JSClassDef = record
447
447
magic:Integer):JSValue; cdecl;
448
448
JSCFunctionType = record
449
449
case Integer of
450
- 0 : ( &generic : PJSCFunction );
450
+ 0 : ( &generic : JSCFunction );
451
451
1 : ( generic_magic : JSCFunctionMagic);
452
- 2 : ( &constructor : PJSCFunction );
452
+ 2 : ( &constructor : JSCFunction );
453
453
3 : ( constructor_magic : constructor_magic_func);
454
- 4 : ( constructor_or_func : PJSCFunction );
454
+ 4 : ( constructor_or_func : JSCFunction );
455
455
5 : ( f_f : f_f_func);
456
456
6 : ( f_f_f : f_f_f_func);
457
457
7 : ( getter : Getter_func);
@@ -843,12 +843,12 @@ function JS_NewCFunctionMagic(ctx : JSContext; func : PJSCFunctionMagic; name :
843
843
844
844
{ C property definition }
845
845
846
- function JS_CFUNC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func1 : JSCFunctionType ) : JSCFunctionListEntry;
846
+ function JS_CFUNC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func : JSCFunction ) : JSCFunctionListEntry;
847
847
function JS_CFUNC_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func1 : JSCFunctionType; magic : Int16) : JSCFunctionListEntry;
848
848
function JS_CFUNC_SPECIAL_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; cproto : JSCFunctionEnum ; func1 : JSCFunctionType) : JSCFunctionListEntry;
849
849
function JS_ITERATOR_NEXT_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func1 : JSCFunctionType; magic : Int16) : JSCFunctionListEntry;
850
- function JS_CGETSET_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter, fsetter : JSCFunctionType ) : JSCFunctionListEntry;
851
- function JS_CGETSET_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter, fsetter : JSCFunctionType ; magic : Int16) : JSCFunctionListEntry;
850
+ function JS_CGETSET_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter : Getter_func; fsetter : Setter_func ) : JSCFunctionListEntry;
851
+ function JS_CGETSET_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter_magic : getter_magic_func; fsetter_magic : setter_magic_func ; magic : Int16) : JSCFunctionListEntry;
852
852
function JS_PROP_STRING_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; val : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; prop_flags : UInt8) : JSCFunctionListEntry;
853
853
function JS_PROP_INT32_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; val : Int32; prop_flags : UInt8) : JSCFunctionListEntry;
854
854
function JS_PROP_INT64_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; val : Int64; prop_flags : UInt8) : JSCFunctionListEntry;
@@ -1296,15 +1296,15 @@ function JS_NewCFunctionMagic(ctx : JSContext; func : PJSCFunctionMagic; name :
1296
1296
1297
1297
{ C property definition }
1298
1298
1299
- function JS_CFUNC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func1 : JSCFunctionType ) : JSCFunctionListEntry;
1299
+ function JS_CFUNC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func : JSCFunction ) : JSCFunctionListEntry;
1300
1300
begin
1301
1301
Result.name := name ;
1302
1302
Result.prop_flags := JS_PROP_WRITABLE or JS_PROP_CONFIGURABLE;
1303
1303
Result.def_type := JS_DEF_CFUNC;
1304
1304
Result.magic := 0 ;
1305
1305
Result.u.func.length := length;
1306
1306
Result.u.func.cproto := JS_CFUNC_generic;
1307
- Result.u.func.cfunc.&generic := func1.& generic ;
1307
+ Result.u.func.cfunc.&generic := func ;
1308
1308
end ;
1309
1309
1310
1310
function JS_CFUNC_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; length : Integer; func1 : JSCFunctionType; magic : Int16) : JSCFunctionListEntry;
@@ -1343,26 +1343,28 @@ function JS_ITERATOR_NEXT_DEF(name : {$IFDEF FPC}PChar{$Else}PAnsiChar{$EndIf};
1343
1343
Result.u.func.cfunc.iterator_next := func1.iterator_next;
1344
1344
end ;
1345
1345
1346
- function JS_CGETSET_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter, fsetter : JSCFunctionType) : JSCFunctionListEntry;
1346
+ function JS_CGETSET_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ;
1347
+ fgetter : Getter_func; fsetter : Setter_func ) : JSCFunctionListEntry;
1347
1348
begin
1348
1349
Result.name := name ;
1349
1350
Result.prop_flags := JS_PROP_CONFIGURABLE;
1350
1351
Result.def_type := JS_DEF_CGETSET;
1351
1352
Result.magic := 0 ;
1352
- // TODO: Check if this type assigment is working or not - Need some test cases.
1353
- Result.u.getset.get := fgetter;
1354
- Result.u.getset._set := fsetter;
1353
+ Result.u.getset.get.getter := fgetter;
1354
+ Result.u.getset._set.setter := fsetter;
1355
1355
end ;
1356
1356
1357
- function JS_CGETSET_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; fgetter, fsetter : JSCFunctionType; magic : Int16) : JSCFunctionListEntry;
1357
+ function JS_CGETSET_MAGIC_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ;
1358
+ fgetter_magic : getter_magic_func;
1359
+ fsetter_magic : setter_magic_func; magic : Int16) : JSCFunctionListEntry;
1358
1360
begin
1359
1361
Result.name := name ;
1360
1362
Result.prop_flags := JS_PROP_CONFIGURABLE;
1361
1363
Result.def_type := JS_DEF_CGETSET_MAGIC;
1362
1364
Result.magic := magic;
1363
1365
// TODO: Check if this type assigment is working or not - Need some test cases.
1364
- Result.u.getset.get.getter_magic := fgetter.getter_magic ;
1365
- Result.u.getset._set.setter_magic := fsetter.setter_magic ;
1366
+ Result.u.getset.get.getter_magic := fgetter_magic ;
1367
+ Result.u.getset._set.setter_magic := fsetter_magic ;
1366
1368
end ;
1367
1369
1368
1370
function JS_PROP_STRING_DEF (name : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; val : { $IFDEF FPC} PChar{ $Else} PAnsiChar{ $EndIf} ; prop_flags : UInt8) : JSCFunctionListEntry;
@@ -1441,12 +1443,12 @@ function JS_ALIAS_BASE_DEF(name, from : {$IFDEF FPC}PChar{$Else}PAnsiChar{$EndIf
1441
1443
end ;
1442
1444
1443
1445
{ bignum stuff :D }
1444
- { $IfDef BIGNUM }
1445
- function c_udivti3 (num,den:uint64):uint64; cdecl; { $ifdef darwin} [ public , alias: ' ___udivti3' ]; { $else} [ public , alias: ' __udivdi3' ]; { $endif}
1446
+
1447
+ function c_udivti3 (num,den:uint64):uint64; cdecl; public alias: { $ifdef darwin} ' ___udivti3' { $else} ' __udivdi3' ]{ $endif} ;
1446
1448
begin
1447
1449
result:=num div den;
1448
1450
end ;
1449
- { $ENDIF }
1451
+
1450
1452
1451
1453
initialization
1452
1454
// fix the Invalid floating point operation .
0 commit comments