Skip to content

Commit fd85898

Browse files
committed
Add ROM built-in lightfunc conversion
1 parent 242359a commit fd85898

3 files changed

Lines changed: 258 additions & 65 deletions

File tree

src/builtins.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
# + e: enumerable
3535
# + c: configurable
3636
# + a: accessor (determined automatically, not necessary to give explicitly)
37+
# - autoLightfunc: if true (which is default), function property may be
38+
# automatically converted to a lightfunc if other automatic lightfunc
39+
# conversion criteria are met; use "autoLightfunc: false" to prevent
40+
# lightfunc conversion
3741
# - May also have feature tags like "es6: true" to indicate property
3842
# is related to a specific standard
3943
# - To disable a property without removing its metadata, you can use
@@ -61,6 +65,13 @@
6165
# - Pointer:
6266
# - type: pointer
6367
# - NOTE: not supported yet, type is reserved
68+
# - Lightfunc:
69+
# - type: lightfunc
70+
# - native: native function name
71+
# - magic: -128 to 127
72+
# - length: 0 to 15
73+
# - nargs: 0 to 14; or varargs: true
74+
# - varargs: if true, target has variable arguments
6475
# - Reference to a built-in object:
6576
# - type: object
6677
# id: ID string of target object
@@ -315,6 +326,7 @@ objects:
315326
type: function
316327
native: duk_bi_global_object_eval
317328
length: 1
329+
autoLightfunc: false # automatic lightfunc conversion clashes with internal implementation
318330
- key: "parseInt"
319331
value:
320332
type: function
@@ -2267,12 +2279,14 @@ objects:
22672279
native: duk_bi_thread_yield
22682280
length: 2
22692281
duktape: true
2282+
autoLightfunc: false # automatic lightfunc conversion clashes with internal implementation
22702283
- key: "resume"
22712284
value:
22722285
type: function
22732286
native: duk_bi_thread_resume
22742287
length: 3
22752288
duktape: true
2289+
autoLightfunc: false # automatic lightfunc conversion clashes with internal implementation
22762290
- key: "current"
22772291
value:
22782292
type: function

0 commit comments

Comments
 (0)