Skip to content

Commit e2e0891

Browse files
committed
properties
1 parent dee16b9 commit e2e0891

File tree

5 files changed

+49
-67
lines changed

5 files changed

+49
-67
lines changed

generated/slua_default.d.luau

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,10 @@ declare llbase64: {
261261

262262
declare lljson: {
263263
null: any,
264-
empty_array_mt: { [any]: any },
265-
array_mt: { [any]: any },
266-
empty_array: any,
267-
_NAME: string,
268-
_VERSION: string,
264+
array_mt: {__jsontype: string},
265+
object_mt: {__jsontype: string},
266+
empty_array: {},
267+
empty_object: {},
269268
encode: (value: any, options: LLJsonEncodeOptions?) -> string,
270269
decode: (json: string, reviver: ((value: any) -> any)?) -> any,
271270
slencode: (value: any, options: LLJsonEncodeOptions?) -> string,

generated/slua_default.docs.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,24 +259,20 @@
259259
"documentation": "A constant to pass for null to json encode",
260260
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
261261
},
262-
"@sl-slua/global/lljson.empty_array_mt": {
263-
"documentation": "Value: {}<br>Metatable for declaring table as an empty array for json encode",
264-
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
265-
},
266262
"@sl-slua/global/lljson.array_mt": {
267-
"documentation": "Value: {}<br>Metatable for declaring table as an array for json encode",
263+
"documentation": "Value: {__jsontype = \"array\"}<br>Metatable for declaring table as an array for json encode",
268264
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
269265
},
270-
"@sl-slua/global/lljson.empty_array": {
271-
"documentation": "A constant to pass for an empty array to json encode",
266+
"@sl-slua/global/lljson.object_mt": {
267+
"documentation": "Value: {__jsontype = \"object\"}<br>Metatable for declaring table as an object for json encode",
272268
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
273269
},
274-
"@sl-slua/global/lljson._NAME": {
275-
"documentation": "Value: \"lljson\"<br>Name of the lljson library",
270+
"@sl-slua/global/lljson.empty_array": {
271+
"documentation": "Value: setmetatable({}, lljson.array_mt}<br>A constant to pass for an empty array to json encode",
276272
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
277273
},
278-
"@sl-slua/global/lljson._VERSION": {
279-
"documentation": "Value: \"2.1.0.11\"<br>Version of the lljson library",
274+
"@sl-slua/global/lljson.empty_object": {
275+
"documentation": "Value: setmetatable({}, lljson.object_mt}<br>A constant to pass for an empty object to json encode",
280276
"learn_more_link": "https://create.secondlife.com/script/learn-slua/json/"
281277
},
282278
"@sl-slua/global/lljson.encode": {

generated/slua_keywords_pretty.xml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -245,48 +245,32 @@ export type rotation = quaternion</string>
245245
<key>value</key>
246246
<string>false</string>
247247
</map>
248-
<key>lljson._NAME</key>
249-
<map>
250-
<key>tooltip</key>
251-
<string>Name of the lljson library</string>
252-
<key>type</key>
253-
<string>string</string>
254-
<key>value</key>
255-
<string>"lljson"</string>
256-
</map>
257-
<key>lljson._VERSION</key>
258-
<map>
259-
<key>tooltip</key>
260-
<string>Version of the lljson library</string>
261-
<key>type</key>
262-
<string>string</string>
263-
<key>value</key>
264-
<string>"2.1.0.11"</string>
265-
</map>
266248
<key>lljson.array_mt</key>
267249
<map>
268250
<key>tooltip</key>
269251
<string>Metatable for declaring table as an array for json encode</string>
270252
<key>type</key>
271-
<string>{ [any]: any }</string>
253+
<string>{__jsontype: string}</string>
272254
<key>value</key>
273-
<string>{}</string>
255+
<string>{__jsontype = "array"}</string>
274256
</map>
275257
<key>lljson.empty_array</key>
276258
<map>
277259
<key>tooltip</key>
278260
<string>A constant to pass for an empty array to json encode</string>
279261
<key>type</key>
280-
<string>any</string>
262+
<string>{}</string>
263+
<key>value</key>
264+
<string>setmetatable({}, lljson.array_mt}</string>
281265
</map>
282-
<key>lljson.empty_array_mt</key>
266+
<key>lljson.empty_object</key>
283267
<map>
284268
<key>tooltip</key>
285-
<string>Metatable for declaring table as an empty array for json encode</string>
269+
<string>A constant to pass for an empty object to json encode</string>
286270
<key>type</key>
287-
<string>{ [any]: any }</string>
288-
<key>value</key>
289271
<string>{}</string>
272+
<key>value</key>
273+
<string>setmetatable({}, lljson.object_mt}</string>
290274
</map>
291275
<key>lljson.null</key>
292276
<map>
@@ -295,6 +279,15 @@ export type rotation = quaternion</string>
295279
<key>type</key>
296280
<string>any</string>
297281
</map>
282+
<key>lljson.object_mt</key>
283+
<map>
284+
<key>tooltip</key>
285+
<string>Metatable for declaring table as an object for json encode</string>
286+
<key>type</key>
287+
<string>{__jsontype: string}</string>
288+
<key>value</key>
289+
<string>{__jsontype = "object"}</string>
290+
</map>
298291
<key>math.huge</key>
299292
<map>
300293
<key>tooltip</key>

generated/slua_selene.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,25 +4340,22 @@ globals:
43404340
lljson.null:
43414341
property: read-only
43424342
description: A constant to pass for null to json encode
4343-
lljson.empty_array_mt:
4344-
property: read-only
4345-
type: table
4346-
description: Metatable for declaring table as an empty array for json encode
43474343
lljson.array_mt:
43484344
property: read-only
43494345
type: table
43504346
description: Metatable for declaring table as an array for json encode
4347+
lljson.object_mt:
4348+
property: read-only
4349+
type: table
4350+
description: Metatable for declaring table as an object for json encode
43514351
lljson.empty_array:
43524352
property: read-only
4353+
type: table
43534354
description: A constant to pass for an empty array to json encode
4354-
lljson._NAME:
4355+
lljson.empty_object:
43554356
property: read-only
4356-
type: string
4357-
description: Name of the lljson library
4358-
lljson._VERSION:
4359-
property: read-only
4360-
type: string
4361-
description: Version of the lljson library
4357+
type: table
4358+
description: A constant to pass for an empty object to json encode
43624359
lljson.encode:
43634360
args:
43644361
- type: any

slua_definitions.yaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,25 +1136,22 @@ modules:
11361136
- name: 'null'
11371137
comment: A constant to pass for null to json encode
11381138
type: any
1139-
- name: empty_array_mt
1140-
comment: Metatable for declaring table as an empty array for json encode
1141-
type: '{ [any]: any }'
1142-
value: '{}'
11431139
- name: array_mt
11441140
comment: Metatable for declaring table as an array for json encode
1145-
type: '{ [any]: any }'
1146-
value: '{}'
1141+
type: '{__jsontype: string}'
1142+
value: '{__jsontype = "array"}'
1143+
- name: object_mt
1144+
comment: Metatable for declaring table as an object for json encode
1145+
type: '{__jsontype: string}'
1146+
value: '{__jsontype = "object"}'
11471147
- name: empty_array
11481148
comment: A constant to pass for an empty array to json encode
1149-
type: any
1150-
- name: _NAME
1151-
comment: Name of the lljson library
1152-
type: string
1153-
value: '"lljson"'
1154-
- name: _VERSION
1155-
comment: Version of the lljson library
1156-
type: string
1157-
value: '"2.1.0.11"'
1149+
type: '{}'
1150+
value: 'setmetatable({}, lljson.array_mt}'
1151+
- name: empty_object
1152+
comment: A constant to pass for an empty object to json encode
1153+
type: '{}'
1154+
value: 'setmetatable({}, lljson.object_mt}'
11581155
- name: math
11591156
comment: Mathematical functions library.
11601157
functions:

0 commit comments

Comments
 (0)