gennady 0.2.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -10
- package/cli/cmd/cat.js +26 -0
- package/cli/cmd/commit.js +83 -0
- package/cli/cmd/review.js +58 -0
- package/cli/gennady.js +19 -40
- package/index.js +2 -0
- package/package.json +5 -3
- package/src/ai/ai-core.js +187 -0
- package/src/cat-gen/cat-gen.js +53 -0
- package/src/commit-gen/commit-gen.js +38 -71
- package/src/git/git-core.js +69 -0
- package/src/git/git-diff.js +36 -13
- package/src/prompts/commit/commit-base-prompt.md +38 -0
- package/src/prompts/commit/commit-format-detailed-prompt.md +29 -0
- package/src/prompts/commit/commit-format-oneline-prompt.md +19 -0
- package/src/prompts/commit/commit-translate-prompt.md +15 -0
- package/src/prompts/index.js +10 -0
- package/src/prompts/review/review-base-prompt.md +46 -0
- package/src/review-gen/__fixture__/review-gen-fixture.md +110 -0
- package/src/review-gen/review-gen.js +119 -0
- package/src/review-gen/review-gen.test.js +79 -0
- package/src/review-gen/specs/js/Function.prototype.json +162 -0
- package/src/review-gen/specs/js/Global.json +219 -0
- package/src/review-gen/specs/js/JSON.json +85 -0
- package/src/review-gen/specs/js/Object.json +626 -0
- package/src/review-gen/specs/js/Object.prototype.json +337 -0
- package/src/review-gen/specs/js/Storage.json +97 -0
- package/src/utils/parse-args.js +7 -3
- package/src/utils/style.js +12 -3
- package/src/git/git-cmd.js +0 -32
- package/src/prompts/base-prompt.md +0 -27
- package/src/prompts/format-detailed-prompt.md +0 -16
- package/src/prompts/format-oneline-prompt.md +0 -11
- package/src/prompts/translate-prompt.md +0 -11
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Object": {
|
|
3
|
+
"description": "The Object constructor creates object wrappers and provides static methods for object manipulation.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"prototype": {
|
|
6
|
+
"value": "Object.prototype",
|
|
7
|
+
"attributes": {
|
|
8
|
+
"writable": false,
|
|
9
|
+
"enumerable": false,
|
|
10
|
+
"configurable": false
|
|
11
|
+
},
|
|
12
|
+
"description": "The prototype object for Object instances. Objects created using object literals or `new Object()` inherit from this object."
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"methods": {
|
|
16
|
+
"assign": {
|
|
17
|
+
"description": "Copies the values of all enumerable own properties from one or more source objects to a target object.",
|
|
18
|
+
"arguments": [
|
|
19
|
+
{
|
|
20
|
+
"name": "target",
|
|
21
|
+
"required": true,
|
|
22
|
+
"description": "The target object — what to apply the sources' properties to, which is returned after it is modified."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "sources",
|
|
26
|
+
"required": true,
|
|
27
|
+
"variadic": true,
|
|
28
|
+
"description": "The source object(s) — objects containing the properties you want to apply."
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"returns": {
|
|
32
|
+
"type": "Object",
|
|
33
|
+
"description": "The modified target object."
|
|
34
|
+
},
|
|
35
|
+
"exceptions": [
|
|
36
|
+
{
|
|
37
|
+
"type": "TypeError",
|
|
38
|
+
"description": "The `target` is null or undefined."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "UserCodeError",
|
|
42
|
+
"description": "An error occurred while accessing a property via getter on a source object."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "UserCodeError",
|
|
46
|
+
"description": "An error occurred while setting a property via setter on the target object."
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"create": {
|
|
51
|
+
"description": "Creates a new object with the specified prototype object and properties.",
|
|
52
|
+
"arguments": [
|
|
53
|
+
{
|
|
54
|
+
"name": "O",
|
|
55
|
+
"required": true,
|
|
56
|
+
"description": "The object which should be the prototype of the newly-created object. Can be `null`."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Properties",
|
|
60
|
+
"required": false,
|
|
61
|
+
"description": "An optional object whose enumerable own properties specify property descriptors to be added to the newly-created object."
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"returns": {
|
|
65
|
+
"type": "Object",
|
|
66
|
+
"description": "A new object with the specified prototype and properties."
|
|
67
|
+
},
|
|
68
|
+
"exceptions": [
|
|
69
|
+
{
|
|
70
|
+
"type": "TypeError",
|
|
71
|
+
"description": "The `O` argument is neither an Object nor `null`."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "TypeError",
|
|
75
|
+
"description": "If `Properties` is provided and is not coercible to an Object."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "TypeError",
|
|
79
|
+
"description": "If `Properties` contains an invalid property descriptor (via `ToPropertyDescriptor`)."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "RangeError",
|
|
83
|
+
"description": "If `Properties` contains an invalid property descriptor attribute value (via `ToPropertyDescriptor`)."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "TypeError",
|
|
87
|
+
"description": "If defining a property from `Properties` fails (e.g., on a non-extensible object, or redefining non-configurable property - via `DefinePropertyOrThrow`)."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "UserCodeError",
|
|
91
|
+
"description": "An error occurred while accessing a property descriptor via getter on the `Properties` object."
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"defineProperties": {
|
|
96
|
+
"description": "Defines new or modifies existing own properties directly on an object.",
|
|
97
|
+
"arguments": [
|
|
98
|
+
{
|
|
99
|
+
"name": "O",
|
|
100
|
+
"required": true,
|
|
101
|
+
"description": "The object on which to define or modify properties."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "Properties",
|
|
105
|
+
"required": true,
|
|
106
|
+
"description": "An object whose own enumerable properties constitute the descriptors for the properties to be defined or modified."
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"returns": {
|
|
110
|
+
"type": "Object",
|
|
111
|
+
"description": "The object that was passed to the function."
|
|
112
|
+
},
|
|
113
|
+
"exceptions": [
|
|
114
|
+
{
|
|
115
|
+
"type": "TypeError",
|
|
116
|
+
"description": "The `O` argument is not an Object."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "TypeError",
|
|
120
|
+
"description": "The `Properties` argument is not coercible to an Object."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "TypeError",
|
|
124
|
+
"description": "If `Properties` contains an invalid property descriptor (via `ToPropertyDescriptor`)."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "RangeError",
|
|
128
|
+
"description": "If `Properties` contains an invalid property descriptor attribute value (via `ToPropertyDescriptor`)."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "TypeError",
|
|
132
|
+
"description": "If defining a property from `Properties` fails (e.g., redefining a non-configurable property - via `DefinePropertyOrThrow`)."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"type": "UserCodeError",
|
|
136
|
+
"description": "An error occurred while accessing a property descriptor via getter on the `Properties` object."
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"defineProperty": {
|
|
141
|
+
"description": "Defines a new own property or modifies an existing own property on an object.",
|
|
142
|
+
"arguments": [
|
|
143
|
+
{
|
|
144
|
+
"name": "O",
|
|
145
|
+
"required": true,
|
|
146
|
+
"description": "The object on which to define or modify the property."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "P",
|
|
150
|
+
"required": true,
|
|
151
|
+
"description": "The property key (String or Symbol) to define or modify."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "Attributes",
|
|
155
|
+
"required": true,
|
|
156
|
+
"description": "The descriptor for the property being defined or modified."
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"returns": {
|
|
160
|
+
"type": "Object",
|
|
161
|
+
"description": "The object that was passed to the function."
|
|
162
|
+
},
|
|
163
|
+
"exceptions": [
|
|
164
|
+
{
|
|
165
|
+
"type": "TypeError",
|
|
166
|
+
"description": "The `O` argument is not an Object."
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"type": "TypeError",
|
|
170
|
+
"description": "The `P` argument cannot be converted to a property key."
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"type": "TypeError",
|
|
174
|
+
"description": "The `Attributes` argument is not a valid property descriptor (via `ToPropertyDescriptor`)."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "RangeError",
|
|
178
|
+
"description": "The `Attributes` argument contains an invalid property descriptor attribute value (via `ToPropertyDescriptor`)."
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"type": "TypeError",
|
|
182
|
+
"description": "If defining the property `P` fails (e.g., redefining a non-configurable property - via `DefinePropertyOrThrow`)."
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
"entries": {
|
|
187
|
+
"description": "Returns an array of a given object's own enumerable string-keyed property [key, value] pairs.",
|
|
188
|
+
"arguments": [
|
|
189
|
+
{
|
|
190
|
+
"name": "O",
|
|
191
|
+
"required": true,
|
|
192
|
+
"description": "The object whose enumerable own property [key, value] pairs are to be returned."
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"returns": {
|
|
196
|
+
"type": "Array",
|
|
197
|
+
"description": "An array of the given object's own enumerable string-keyed property [key, value] pairs."
|
|
198
|
+
},
|
|
199
|
+
"exceptions": [
|
|
200
|
+
{
|
|
201
|
+
"type": "TypeError",
|
|
202
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "UserCodeError",
|
|
206
|
+
"description": "An error occurred while retrieving a property value via getter during enumeration."
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"freeze": {
|
|
211
|
+
"description": "Freezes an object. A frozen object can no longer be changed.",
|
|
212
|
+
"arguments": [
|
|
213
|
+
{
|
|
214
|
+
"name": "O",
|
|
215
|
+
"required": true,
|
|
216
|
+
"description": "The object to freeze."
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"returns": {
|
|
220
|
+
"type": "Object",
|
|
221
|
+
"description": "The object that was passed to the function (or the input value if not an object)."
|
|
222
|
+
},
|
|
223
|
+
"exceptions": [
|
|
224
|
+
{
|
|
225
|
+
"type": "TypeError",
|
|
226
|
+
"description": "Thrown if setting the integrity level to 'frozen' fails (e.g., trying to make a non-configurable property non-writable)."
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"fromEntries": {
|
|
231
|
+
"description": "Transforms a list of [key, value] pairs into an object.",
|
|
232
|
+
"arguments": [
|
|
233
|
+
{
|
|
234
|
+
"name": "iterable",
|
|
235
|
+
"required": true,
|
|
236
|
+
"description": "An iterable object (like Array, Map) that produces [key, value] pairs."
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"returns": {
|
|
240
|
+
"type": "Object",
|
|
241
|
+
"description": "A new object whose properties are given by the entries of the iterable."
|
|
242
|
+
},
|
|
243
|
+
"exceptions": [
|
|
244
|
+
{
|
|
245
|
+
"type": "TypeError",
|
|
246
|
+
"description": "The `iterable` argument is null or undefined."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"type": "TypeError",
|
|
250
|
+
"description": "The `iterable` argument is not actually iterable or the iterator does not return objects."
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"type": "TypeError",
|
|
254
|
+
"description": "An element yielded by the iterator cannot be converted to a property key."
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"type": "UserCodeError",
|
|
258
|
+
"description": "An error occurred during iteration (e.g., in iterator's `next` method)."
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
"getOwnPropertyDescriptor": {
|
|
263
|
+
"description": "Returns a property descriptor for an own property (that is, one directly present on an object and not in the object's prototype chain) of a given object.",
|
|
264
|
+
"arguments": [
|
|
265
|
+
{
|
|
266
|
+
"name": "O",
|
|
267
|
+
"required": true,
|
|
268
|
+
"description": "The object in which to look for the property."
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "P",
|
|
272
|
+
"required": true,
|
|
273
|
+
"description": "The property key (String or Symbol) of the property whose description is to be retrieved."
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"returns": {
|
|
277
|
+
"type": "Object | undefined",
|
|
278
|
+
"description": "A property descriptor of the given property if it exists on the object, `undefined` otherwise."
|
|
279
|
+
},
|
|
280
|
+
"exceptions": [
|
|
281
|
+
{
|
|
282
|
+
"type": "TypeError",
|
|
283
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"type": "TypeError",
|
|
287
|
+
"description": "The `P` argument cannot be converted to a property key."
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"getOwnPropertyDescriptors": {
|
|
292
|
+
"description": "Returns an object containing all own property descriptors for an object.",
|
|
293
|
+
"arguments": [
|
|
294
|
+
{
|
|
295
|
+
"name": "O",
|
|
296
|
+
"required": true,
|
|
297
|
+
"description": "The object for which to get all own property descriptors."
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"returns": {
|
|
301
|
+
"type": "Object",
|
|
302
|
+
"description": "An object containing all own property descriptors of the given object."
|
|
303
|
+
},
|
|
304
|
+
"exceptions": [
|
|
305
|
+
{
|
|
306
|
+
"type": "TypeError",
|
|
307
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
"getOwnPropertyNames": {
|
|
312
|
+
"description": "Returns an array of all own String-keyed property names found directly upon a given object.",
|
|
313
|
+
"arguments": [
|
|
314
|
+
{
|
|
315
|
+
"name": "O",
|
|
316
|
+
"required": true,
|
|
317
|
+
"description": "The object whose own String property names are to be returned."
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"returns": {
|
|
321
|
+
"type": "Array",
|
|
322
|
+
"description": "An array of strings that correspond to the own String property names of the given object."
|
|
323
|
+
},
|
|
324
|
+
"exceptions": [
|
|
325
|
+
{
|
|
326
|
+
"type": "TypeError",
|
|
327
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"getOwnPropertySymbols": {
|
|
332
|
+
"description": "Returns an array of all own Symbol-keyed property names found directly upon a given object.",
|
|
333
|
+
"arguments": [
|
|
334
|
+
{
|
|
335
|
+
"name": "O",
|
|
336
|
+
"required": true,
|
|
337
|
+
"description": "The object whose own Symbol property names are to be returned."
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"returns": {
|
|
341
|
+
"type": "Array",
|
|
342
|
+
"description": "An array of symbols that correspond to the own Symbol property names of the given object."
|
|
343
|
+
},
|
|
344
|
+
"exceptions": [
|
|
345
|
+
{
|
|
346
|
+
"type": "TypeError",
|
|
347
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
"getPrototypeOf": {
|
|
352
|
+
"description": "Returns the prototype (i.e., the value of the internal [[Prototype]] property) of the specified object.",
|
|
353
|
+
"arguments": [
|
|
354
|
+
{
|
|
355
|
+
"name": "O",
|
|
356
|
+
"required": true,
|
|
357
|
+
"description": "The object whose prototype is to be returned."
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"returns": {
|
|
361
|
+
"type": "Object | null",
|
|
362
|
+
"description": "The prototype of the given object. If there are no inherited properties, `null` is returned."
|
|
363
|
+
},
|
|
364
|
+
"exceptions": [
|
|
365
|
+
{
|
|
366
|
+
"type": "TypeError",
|
|
367
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
"groupBy": {
|
|
372
|
+
"description": "Groups the elements of a given iterable according to the string values returned by a provided callback function. The returned object has properties for each group, containing arrays with the elements in the group.",
|
|
373
|
+
"arguments": [
|
|
374
|
+
{
|
|
375
|
+
"name": "items",
|
|
376
|
+
"required": true,
|
|
377
|
+
"description": "An iterable (such as an Array) whose elements will be grouped."
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "callback",
|
|
381
|
+
"required": true,
|
|
382
|
+
"description": "A function to execute for each element in the iterable. It should return a value that can be coerced into a property key (string or symbol)."
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"returns": {
|
|
386
|
+
"type": "Object",
|
|
387
|
+
"description": "A null-prototype object with properties for each group. Each property value is an array containing the elements of the group."
|
|
388
|
+
},
|
|
389
|
+
"exceptions": [
|
|
390
|
+
{
|
|
391
|
+
"type": "TypeError",
|
|
392
|
+
"description": "The `items` argument is not iterable."
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"type": "TypeError",
|
|
396
|
+
"description": "The `callback` argument is not a function."
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "UserCodeError",
|
|
400
|
+
"description": "An error was thrown by the `callback` function."
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"type": "TypeError",
|
|
404
|
+
"description": "The value returned by `callback` cannot be converted to a property key."
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"type": "UserCodeError",
|
|
408
|
+
"description": "An error occurred during iteration of `items`."
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
"hasOwn": {
|
|
413
|
+
"description": "Returns true if the specified object has the indicated property as its own property. If the property is inherited, or does not exist, the method returns false.",
|
|
414
|
+
"arguments": [
|
|
415
|
+
{
|
|
416
|
+
"name": "O",
|
|
417
|
+
"required": true,
|
|
418
|
+
"description": "The object to test."
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "P",
|
|
422
|
+
"required": true,
|
|
423
|
+
"description": "The property key (String or Symbol) to test for."
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
"returns": {
|
|
427
|
+
"type": "Boolean",
|
|
428
|
+
"description": "`true` if the object has the specified property as own property; `false` otherwise."
|
|
429
|
+
},
|
|
430
|
+
"exceptions": [
|
|
431
|
+
{
|
|
432
|
+
"type": "TypeError",
|
|
433
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"type": "TypeError",
|
|
437
|
+
"description": "The `P` argument cannot be converted to a property key."
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
"is": {
|
|
442
|
+
"description": "Compares if two values are the same value. Equates all NaN values (which differs from both Abstract Equality Comparison and Strict Equality Comparison) and distinguishes between +0 and -0.",
|
|
443
|
+
"arguments": [
|
|
444
|
+
{
|
|
445
|
+
"name": "value1",
|
|
446
|
+
"required": true,
|
|
447
|
+
"description": "The first value to compare."
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "value2",
|
|
451
|
+
"required": true,
|
|
452
|
+
"description": "The second value to compare."
|
|
453
|
+
}
|
|
454
|
+
],
|
|
455
|
+
"returns": {
|
|
456
|
+
"type": "Boolean",
|
|
457
|
+
"description": "A Boolean indicating whether or not the two arguments are the same value."
|
|
458
|
+
},
|
|
459
|
+
"exceptions": []
|
|
460
|
+
},
|
|
461
|
+
"isExtensible": {
|
|
462
|
+
"description": "Determines if an object is extensible (whether it can have new properties added to it).",
|
|
463
|
+
"arguments": [
|
|
464
|
+
{
|
|
465
|
+
"name": "O",
|
|
466
|
+
"required": true,
|
|
467
|
+
"description": "The object to check."
|
|
468
|
+
}
|
|
469
|
+
],
|
|
470
|
+
"returns": {
|
|
471
|
+
"type": "Boolean",
|
|
472
|
+
"description": "A Boolean indicating whether or not the given object is extensible."
|
|
473
|
+
},
|
|
474
|
+
"exceptions": []
|
|
475
|
+
},
|
|
476
|
+
"isFrozen": {
|
|
477
|
+
"description": "Determines if an object is frozen.",
|
|
478
|
+
"arguments": [
|
|
479
|
+
{
|
|
480
|
+
"name": "O",
|
|
481
|
+
"required": true,
|
|
482
|
+
"description": "The object to check."
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
"returns": {
|
|
486
|
+
"type": "Boolean",
|
|
487
|
+
"description": "A Boolean indicating whether or not the given object is frozen."
|
|
488
|
+
},
|
|
489
|
+
"exceptions": []
|
|
490
|
+
},
|
|
491
|
+
"isSealed": {
|
|
492
|
+
"description": "Determines if an object is sealed.",
|
|
493
|
+
"arguments": [
|
|
494
|
+
{
|
|
495
|
+
"name": "O",
|
|
496
|
+
"required": true,
|
|
497
|
+
"description": "The object to check."
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"returns": {
|
|
501
|
+
"type": "Boolean",
|
|
502
|
+
"description": "A Boolean indicating whether or not the given object is sealed."
|
|
503
|
+
},
|
|
504
|
+
"exceptions": []
|
|
505
|
+
},
|
|
506
|
+
"keys": {
|
|
507
|
+
"description": "Returns an array of a given object's own enumerable string-keyed property names.",
|
|
508
|
+
"arguments": [
|
|
509
|
+
{
|
|
510
|
+
"name": "O",
|
|
511
|
+
"required": true,
|
|
512
|
+
"description": "The object whose enumerable own property names are to be returned."
|
|
513
|
+
}
|
|
514
|
+
],
|
|
515
|
+
"returns": {
|
|
516
|
+
"type": "Array",
|
|
517
|
+
"description": "An array of strings representing all the enumerable own properties of the given object."
|
|
518
|
+
},
|
|
519
|
+
"exceptions": [
|
|
520
|
+
{
|
|
521
|
+
"type": "TypeError",
|
|
522
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
523
|
+
}
|
|
524
|
+
]
|
|
525
|
+
},
|
|
526
|
+
"preventExtensions": {
|
|
527
|
+
"description": "Prevents new properties from ever being added to an object (i.e. prevents future extensions to the object).",
|
|
528
|
+
"arguments": [
|
|
529
|
+
{
|
|
530
|
+
"name": "O",
|
|
531
|
+
"required": true,
|
|
532
|
+
"description": "The object which should be made non-extensible."
|
|
533
|
+
}
|
|
534
|
+
],
|
|
535
|
+
"returns": {
|
|
536
|
+
"type": "Object",
|
|
537
|
+
"description": "The object being made non-extensible (or the input value if not an object)."
|
|
538
|
+
},
|
|
539
|
+
"exceptions": [
|
|
540
|
+
{
|
|
541
|
+
"type": "TypeError",
|
|
542
|
+
"description": "If preventing extensions fails internally (e.g., on certain Proxy objects)."
|
|
543
|
+
}
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
"seal": {
|
|
547
|
+
"description": "Seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed as long as they are writable.",
|
|
548
|
+
"arguments": [
|
|
549
|
+
{
|
|
550
|
+
"name": "O",
|
|
551
|
+
"required": true,
|
|
552
|
+
"description": "The object to seal."
|
|
553
|
+
}
|
|
554
|
+
],
|
|
555
|
+
"returns": {
|
|
556
|
+
"type": "Object",
|
|
557
|
+
"description": "The object being sealed (or the input value if not an object)."
|
|
558
|
+
},
|
|
559
|
+
"exceptions": [
|
|
560
|
+
{
|
|
561
|
+
"type": "TypeError",
|
|
562
|
+
"description": "Thrown if setting the integrity level to 'sealed' fails (e.g., trying to make a non-configurable property non-configurable again - although this specific case usually succeeds)."
|
|
563
|
+
}
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
"setPrototypeOf": {
|
|
567
|
+
"description": "Sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or null.",
|
|
568
|
+
"arguments": [
|
|
569
|
+
{
|
|
570
|
+
"name": "O",
|
|
571
|
+
"required": true,
|
|
572
|
+
"description": "The object which is to have its prototype set."
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"name": "proto",
|
|
576
|
+
"required": true,
|
|
577
|
+
"description": "The object's new prototype (an object or null)."
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"returns": {
|
|
581
|
+
"type": "Object",
|
|
582
|
+
"description": "The specified object `O` (or the input if not coercible to object)."
|
|
583
|
+
},
|
|
584
|
+
"exceptions": [
|
|
585
|
+
{
|
|
586
|
+
"type": "TypeError",
|
|
587
|
+
"description": "The `O` argument is null or undefined."
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"type": "TypeError",
|
|
591
|
+
"description": "The `proto` argument is neither an Object nor `null`."
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"type": "TypeError",
|
|
595
|
+
"description": "The operation fails internally (e.g. `O` is non-extensible, or a prototype chain cycle would be created)."
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
"values": {
|
|
600
|
+
"description": "Returns an array of a given object's own enumerable property values.",
|
|
601
|
+
"arguments": [
|
|
602
|
+
{
|
|
603
|
+
"name": "O",
|
|
604
|
+
"required": true,
|
|
605
|
+
"description": "The object whose enumerable own property values are to be returned."
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"returns": {
|
|
609
|
+
"type": "Array",
|
|
610
|
+
"description": "An array containing the object's own enumerable property values."
|
|
611
|
+
},
|
|
612
|
+
"exceptions": [
|
|
613
|
+
{
|
|
614
|
+
"type": "TypeError",
|
|
615
|
+
"description": "The `O` argument is not coercible to an Object."
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"type": "UserCodeError",
|
|
619
|
+
"description": "An error occurred while retrieving a property value via getter during enumeration."
|
|
620
|
+
}
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|