-
Notifications
You must be signed in to change notification settings - Fork 3
/
ChakraExternDefinitions.xml
4408 lines (4408 loc) · 170 KB
/
ChakraExternDefinitions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ChakraDefinitions>
<!--
***************************************
**
** ChakraCore.h
**
***************************************
-->
<Export name="JsCreateEnhancedFunction" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates a new enhanced JavaScript function.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="nativeFunction">The method to call when the function is invoked.</param>
/// <param name="metadata">If this is not <c>JS_INVALID_REFERENCE</c>, it is converted to a string and used as the name of the function.</param>
/// <param name="callbackState">
/// User provided state that will be passed back to the callback.
/// </param>
/// <param name="function">The new function object.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsEnhancedNativeFunction" name="nativeFunction" />
<Parameter type="JsValueRef" name="metadata" />
<Parameter type="IntPtr" name="callbackState" />
<Parameter type="JsValueRef" name="function" direction="Out" />
</Parameters>
</Export>
<Export name="JsInitializeModuleRecord" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Initialize a ModuleRecord from host
/// </summary>
/// <remarks>
/// Bootstrap the module loading process by creating a new module record.
/// </remarks>
/// <param name="referencingModule">The parent module of the new module - nullptr for a root module.</param>
/// <param name="normalizedSpecifier">The normalized specifier for the module.</param>
/// <param name="moduleRecord">The new module record. The host should not try to call this API twice
/// with the same normalizedSpecifier.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsModuleRecord" name="referencingModule" />
<Parameter type="JsValueRef" name="normalizedSpecifier" />
<Parameter type="JsModuleRecord" name="moduleRecord" direction="Out" />
</Parameters>
</Export>
<Export name="JsParseModuleSource" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Parse the source for an ES module
/// </summary>
/// <remarks>
/// This is basically ParseModule operation in ES6 spec. It is slightly different in that:
/// a) The ModuleRecord was initialized earlier, and passed in as an argument.
/// b) This includes a check to see if the module being Parsed is the last module in the
/// dependency tree. If it is it automatically triggers Module Instantiation.
/// </remarks>
/// <param name="requestModule">The ModuleRecord being parsed.</param>
/// <param name="sourceContext">A cookie identifying the script that can be used by debuggable script contexts.</param>
/// <param name="script">The source script to be parsed, but not executed in this code.</param>
/// <param name="scriptLength">The length of sourceText in bytes. As the input might contain a embedded null.</param>
/// <param name="sourceFlag">The type of the source code passed in. It could be utf16 or utf8 at this time.</param>
/// <param name="exceptionValueRef">The error object if there is parse error.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsModuleRecord" name="requestModule" />
<Parameter type="JsSourceContext" name="sourceContext" />
<Parameter type="byte[]" name="script" />
<Parameter type="uint" name="scriptLength" />
<Parameter type="JsParseModuleSourceFlags" name="sourceFlag" />
<Parameter type="JsValueRef" name="exceptionValueRef" direction="Out" />
</Parameters>
</Export>
<Export name="JsModuleEvaluation" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Execute module code.
/// </summary>
/// <remarks>
/// This method implements 15.2.1.1.6.5, "ModuleEvaluation" concrete method.
/// This method should be called after the engine notifies the host that the module is ready.
/// This method only needs to be called on root modules - it will execute all of the dependent modules.
///
/// One moduleRecord will be executed only once. Additional execution call on the same moduleRecord will fail.
/// </remarks>
/// <param name="requestModule">The ModuleRecord being executed.</param>
/// <param name="result">The return value of the module.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsModuleRecord" name="requestModule" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsSetModuleHostInfo" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Set host info for the specified module.
/// </summary>
/// <remarks>
/// This is used for four things:
/// 1. Setting up the callbacks for module loading - note these are actually
/// set on the current Context not the module so only have to be set for
/// the first root module in any given context.
/// 2. Setting host defined info on a module record - can be anything that
/// you wish to associate with your modules.
/// 3. Setting a URL for a module to be used for stack traces/debugging -
/// note this must be set before calling JsParseModuleSource on the module
/// or it will be ignored.
/// 4. Setting an exception on the module object - only relevant prior to it being Parsed.
/// </remarks>
/// <param name="requestModule">The request module.</param>
/// <param name="moduleHostInfo">The type of host info to be set.</param>
/// <param name="hostInfo">The host info to be set.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsModuleRecord" name="requestModule" />
<Parameter type="JsModuleHostInfoKind" name="moduleHostInfo" />
<Parameter type="IntPtr" name="hostInfo" />
</Parameters>
</Export>
<Export name="JsGetModuleHostInfo" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Retrieve the host info for the specified module.
/// </summary>
/// <remarks>
/// This can used to retrieve info previously set with JsSetModuleHostInfo.
/// </remarks>
/// <param name="requestModule">The request module.</param>
/// <param name="moduleHostInfo">The type of host info to be retrieved.</param>
/// <param name="hostInfo">The retrieved host info for the module.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsModuleRecord" name="requestModule" />
<Parameter type="JsModuleHostInfoKind" name="moduleHostInfo" />
<Parameter type="IntPtr" name="hostInfo" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetAndClearExceptionWithMetadata" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Returns metadata relating to the exception that caused the runtime of the current context
/// to be in the exception state and resets the exception state for that runtime. The metadata
/// includes a reference to the exception itself.
/// </summary>
/// <remarks>
/// <para>
/// If the runtime of the current context is not in an exception state, this API will return
/// <c>JsErrorInvalidArgument</c>. If the runtime is disabled, this will return an exception
/// indicating that the script was terminated, but it will not clear the exception (the
/// exception will be cleared if the runtime is re-enabled using
/// <c>JsEnableRuntimeExecution</c>).
/// </para>
/// <para>
/// The metadata value is a javascript object with the following properties: <c>exception</c>, the
/// thrown exception object; <c>line</c>, the 0 indexed line number where the exception was thrown;
/// <c>column</c>, the 0 indexed column number where the exception was thrown; <c>length</c>, the
/// source-length of the cause of the exception; <c>source</c>, a string containing the line of
/// source code where the exception was thrown; and <c>url</c>, a string containing the name of
/// the script file containing the code that threw the exception.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <param name="metadata">The exception metadata for the runtime of the current context.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="metadata" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreateString" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Create JavascriptString variable from ASCII or Utf8 string
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// Input string can be either ASCII or Utf8
/// </para>
/// </remarks>
/// <param name="content">Pointer to string memory.</param>
/// <param name="length">Number of bytes within the string</param>
/// <param name="value">JsValueRef representing the JavascriptString</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="string" name="content" />
<Parameter type="size_t" name="length" />
<Parameter type="JsValueRef" name="value" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreateStringUtf16" target="Common" source="ChakraCore.h" dllImportEx=", CharSet = CharSet.Unicode">
<Description>
<![CDATA[
/// <summary>
/// Create JavascriptString variable from Utf16 string
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// Expects Utf16 string
/// </para>
/// </remarks>
/// <param name="content">Pointer to string memory.</param>
/// <param name="length">Number of characters within the string</param>
/// <param name="value">JsValueRef representing the JavascriptString</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="string" name="content" />
<Parameter type="size_t" name="length" />
<Parameter type="JsValueRef" name="value" direction="Out" />
</Parameters>
</Export>
<Export name="JsCopyString" target="Common" source="ChakraCore.h" dllImportEx=", CharSet = CharSet.Ansi">
<Description>
<![CDATA[
/// <summary>
/// Write JavascriptString value into C string buffer (Utf8)
/// </summary>
/// <remarks>
/// <para>
/// When size of the `buffer` is unknown,
/// `buffer` argument can be nullptr.
/// In that case, `length` argument will return the length needed.
/// </para>
/// </remarks>
/// <param name="value">JavascriptString value</param>
/// <param name="buffer">Pointer to buffer</param>
/// <param name="bufferSize">Buffer size</param>
/// <param name="length">Total number of characters needed or written</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="value" />
<Parameter type="char*" name="buffer" />
<Parameter type="size_t" name="bufferSize" />
<Parameter type="size_t" name="length" direction="Out" />
</Parameters>
</Export>
<Export name="JsCopyStringUtf16" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Write string value into Utf16 string buffer
/// </summary>
/// <remarks>
/// <para>
/// When size of the `buffer` is unknown,
/// `buffer` argument can be nullptr.
/// In that case, `written` argument will return the length needed.
/// </para>
/// <para>
/// when start is out of range or < 0, returns JsErrorInvalidArgument
/// and `written` will be equal to 0.
/// If calculated length is 0 (It can be due to string length or `start`
/// and length combination), then `written` will be equal to 0 and call
/// returns JsNoError
/// </para>
/// </remarks>
/// <param name="value">JavascriptString value</param>
/// <param name="start">start offset of buffer</param>
/// <param name="length">length to be written</param>
/// <param name="buffer">Pointer to buffer</param>
/// <param name="written">Total number of characters written</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="value" />
<Parameter type="int" name="start" />
<Parameter type="int" name="length" />
<Parameter type="uint16_t*" name="buffer" />
<Parameter type="size_t" name="written" direction="Out" />
</Parameters>
</Export>
<Export name="JsParse" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Parses a script and returns a function representing the script.
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// Script source can be either JavascriptString or JavascriptExternalArrayBuffer.
/// In case it is an ExternalArrayBuffer, and the encoding of the buffer is Utf16,
/// JsParseScriptAttributeArrayBufferIsUtf16Encoded is expected on parseAttributes.
/// </para>
/// <para>
/// Use JavascriptExternalArrayBuffer with Utf8/ASCII script source
/// for better performance and smaller memory footprint.
/// </para>
/// </remarks>
/// <param name="script">The script to run.</param>
/// <param name="sourceContext">
/// A cookie identifying the script that can be used by debuggable script contexts.
/// </param>
/// <param name="sourceUrl">The location the script came from.</param>
/// <param name="parseAttributes">Attribute mask for parsing the script</param>
/// <param name="result">The result of the compiled script.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="script" />
<Parameter type="JsSourceContext" name="sourceContext" />
<Parameter type="JsValueRef" name="sourceUrl" />
<Parameter type="JsParseScriptAttributes" name="parseAttributes" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsRun" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Executes a script.
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// Script source can be either JavascriptString or JavascriptExternalArrayBuffer.
/// In case it is an ExternalArrayBuffer, and the encoding of the buffer is Utf16,
/// JsParseScriptAttributeArrayBufferIsUtf16Encoded is expected on parseAttributes.
/// </para>
/// <para>
/// Use JavascriptExternalArrayBuffer with Utf8/ASCII script source
/// for better performance and smaller memory footprint.
/// </para>
/// </remarks>
/// <param name="script">The script to run.</param>
/// <param name="sourceContext">
/// A cookie identifying the script that can be used by debuggable script contexts.
/// </param>
/// <param name="sourceUrl">The location the script came from</param>
/// <param name="parseAttributes">Attribute mask for parsing the script</param>
/// <param name="result">The result of the script, if any. This parameter can be null.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="script" />
<Parameter type="JsSourceContext" name="sourceContext" />
<Parameter type="JsValueRef" name="sourceUrl" />
<Parameter type="JsParseScriptAttributes" name="parseAttributes" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreatePropertyId" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates the property ID associated with the name.
/// </summary>
/// <remarks>
/// <para>
/// Property IDs are specific to a context and cannot be used across contexts.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <param name="name">
/// The name of the property ID to get or create. The name may consist of only digits.
/// The string is expected to be ASCII / utf8 encoded.
/// </param>
/// <param name="length">length of the name in bytes</param>
/// <param name="propertyId">The property ID in this runtime for the given name.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="string" name="name" />
<Parameter type="size_t" name="length" />
<Parameter type="JsPropertyIdRef" name="propertyId" direction="Out" />
</Parameters>
</Export>
<Export name="JsCopyPropertyId" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Copies the name associated with the property ID into a buffer.
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// When size of the `buffer` is unknown,
/// `buffer` argument can be nullptr.
/// `length` argument will return the size needed.
/// </para>
/// </remarks>
/// <param name="propertyId">The property ID to get the name of.</param>
/// <param name="buffer">The buffer holding the name associated with the property ID, encoded as utf8</param>
/// <param name="bufferSize">Size of the buffer.</param>
/// <param name="written">Total number of characters written or to be written</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsPropertyIdRef" name="propertyId" />
<Parameter type="char*" name="buffer" />
<Parameter type="size_t" name="bufferSize" />
<Parameter type="size_t" name="length" direction="Out" />
</Parameters>
</Export>
<Export name="JsSerialize" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Serializes a parsed script to a buffer than can be reused.
/// </summary>
/// <remarks>
/// <para>
/// <c>JsSerializeScript</c> parses a script and then stores the parsed form of the script in a
/// runtime-independent format. The serialized script then can be deserialized in any
/// runtime without requiring the script to be re-parsed.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// Script source can be either JavascriptString or JavascriptExternalArrayBuffer.
/// In case it is an ExternalArrayBuffer, and the encoding of the buffer is Utf16,
/// JsParseScriptAttributeArrayBufferIsUtf16Encoded is expected on parseAttributes.
/// </para>
/// <para>
/// Use JavascriptExternalArrayBuffer with Utf8/ASCII script source
/// for better performance and smaller memory footprint.
/// </para>
/// </remarks>
/// <param name="script">The script to serialize</param>
/// <param name="buffer">ArrayBuffer</param>
/// <param name="parseAttributes">Encoding for the script.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="script" />
<Parameter type="JsValueRef" name="buffer" direction="Out" />
<Parameter type="JsParseScriptAttributes" name="parseAttributes" />
</Parameters>
</Export>
<Export name="JsParseSerialized" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Parses a serialized script and returns a function representing the script.
/// Provides the ability to lazy load the script source only if/when it is needed.
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <param name="buffer">The serialized script as an ArrayBuffer (preferably ExternalArrayBuffer).</param>
/// <param name="scriptLoadCallback">
/// Callback called when the source code of the script needs to be loaded.
/// This is an optional parameter, set to null if not needed.
/// </param>
/// <param name="sourceContext">
/// A cookie identifying the script that can be used by debuggable script contexts.
/// This context will passed into scriptLoadCallback.
/// </param>
/// <param name="sourceUrl">The location the script came from.</param>
/// <param name="result">A function representing the script code.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="buffer" />
<Parameter type="JsSerializedLoadScriptCallback" name="scriptLoadCallback" />
<Parameter type="JsSourceContext" name="sourceContext" />
<Parameter type="JsValueRef" name="sourceUrl" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsRunSerialized" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Runs a serialized script.
/// Provides the ability to lazy load the script source only if/when it is needed.
/// </summary>
/// <remarks>
/// <para>
/// Requires an active script context.
/// </para>
/// <para>
/// The runtime will detach the data from the buffer and hold on to it until all
/// instances of any functions created from the buffer are garbage collected.
/// </para>
/// </remarks>
/// <param name="buffer">The serialized script as an ArrayBuffer (preferably ExternalArrayBuffer).</param>
/// <param name="scriptLoadCallback">Callback called when the source code of the script needs to be loaded.</param>
/// <param name="sourceContext">
/// A cookie identifying the script that can be used by debuggable script contexts.
/// This context will passed into scriptLoadCallback.
/// </param>
/// <param name="sourceUrl">The location the script came from.</param>
/// <param name="result">
/// The result of running the script, if any. This parameter can be null.
/// </param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="buffer" />
<Parameter type="JsSerializedLoadScriptCallback" name="scriptLoadCallback" />
<Parameter type="JsSourceContext" name="sourceContext" />
<Parameter type="JsValueRef" name="sourceUrl" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetPromiseState" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Gets the state of a given Promise object.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="promise">The Promise object.</param>
/// <param name="state">The current state of the Promise.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="promise" />
<Parameter type="JsPromiseState" name="state" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetPromiseResult" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Gets the result of a given Promise object.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="promise">The Promise object.</param>
/// <param name="result">The result of the Promise.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="promise" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreatePromise" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates a new JavaScript Promise object.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="promise">The new Promise object.</param>
/// <param name="resolveFunction">The function called to resolve the created Promise object.</param>
/// <param name="rejectFunction">The function called to reject the created Promise object.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="promise" direction="Out" />
<Parameter type="JsValueRef" name="resolveFunction" direction="Out" />
<Parameter type="JsValueRef" name="rejectFunction" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreateWeakReference" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates a weak reference to a value.
/// </summary>
/// <param name="value">The value to be referenced.</param>
/// <param name="weakRef">Weak reference to the value.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="value" />
<Parameter type="IntPtr" name="weakRef" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetWeakReferenceValue" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Gets a strong reference to the value referred to by a weak reference.
/// </summary>
/// <param name="weakRef">A weak reference.</param>
/// <param name="value">Reference to the value, or <c>JS_INVALID_REFERENCE</c> if the value is
/// no longer available.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsWeakRef" name="weakRef" />
<Parameter type="JsValueRef" name="value" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreateSharedArrayBufferWithSharedContent" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates a Javascript SharedArrayBuffer object with shared content get from JsGetSharedArrayBufferContent.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="sharedContents">
/// The storage object of a SharedArrayBuffer which can be shared between multiple thread.
/// </param>
/// <param name="result">The new SharedArrayBuffer object.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsSharedArrayBufferContentHandle" name="sharedContents" />
<Parameter type="JsValueRef" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetSharedArrayBufferContent" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Get the storage object from a SharedArrayBuffer.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="sharedArrayBuffer">The SharedArrayBuffer object.</param>
/// <param name="sharedContents">
/// The storage object of a SharedArrayBuffer which can be shared between multiple thread.
/// User should call JsReleaseSharedArrayBufferContentHandle after finished using it.
/// </param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="sharedArrayBuffer" />
<Parameter type="IntPtr" name="sharedContents" direction="Out" />
</Parameters>
</Export>
<Export name="JsReleaseSharedArrayBufferContentHandle" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Decrease the reference count on a SharedArrayBuffer storage object.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="sharedContents">
/// The storage object of a SharedArrayBuffer which can be shared between multiple thread.
/// </param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsSharedArrayBufferContentHandle" name="sharedContents" />
</Parameters>
</Export>
<Export name="JsHasOwnProperty" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Determines whether an object has a non-inherited property.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="object">The object that may contain the property.</param>
/// <param name="propertyId">The ID of the property.</param>
/// <param name="hasOwnProperty">Whether the object has the non-inherited property.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="@object" />
<Parameter type="JsPropertyIdRef" name="propertyId" />
<Parameter type="bool" name="hasOwnProperty" direction="Out" />
</Parameters>
</Export>
<Export name="JsCopyStringOneByte" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Write JS string value into char string buffer without a null terminator
/// </summary>
/// <remarks>
/// <para>
/// When size of the `buffer` is unknown,
/// `buffer` argument can be nullptr.
/// In that case, `written` argument will return the length needed.
/// </para>
/// <para>
/// When start is out of range or < 0, returns JsErrorInvalidArgument
/// and `written` will be equal to 0.
/// If calculated length is 0 (It can be due to string length or `start`
/// and length combination), then `written` will be equal to 0 and call
/// returns JsNoError
/// </para>
/// <para>
/// The JS string `value` will be converted one utf16 code point at a time,
/// and if it has code points that do not fit in one byte, those values
/// will be truncated.
/// </para>
/// </remarks>
/// <param name="value">JavascriptString value</param>
/// <param name="start">Start offset of buffer</param>
/// <param name="length">Number of characters to be written</param>
/// <param name="buffer">Pointer to buffer</param>
/// <param name="written">Total number of characters written</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="value" />
<Parameter type="int" name="start" />
<Parameter type="int" name="length" />
<Parameter type="char*" name="buffer" />
<Parameter type="size_t" name="written" direction="Out" />
</Parameters>
</Export>
<Export name="JsGetDataViewInfo" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Obtains frequently used properties of a data view.
/// </summary>
/// <param name="dataView">The data view instance.</param>
/// <param name="arrayBuffer">The ArrayBuffer backstore of the view.</param>
/// <param name="byteOffset">The offset in bytes from the start of arrayBuffer referenced by the array.</param>
/// <param name="byteLength">The number of bytes in the array.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="dataView" />
<Parameter type="JsValueRef" name="arrayBuffer" direction="Out" />
<Parameter type="uint" name="byteOffset" direction="Out" />
<Parameter type="uint" name="byteLength" direction="Out" />
</Parameters>
</Export>
<Export name="JsLessThan" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Determine if one JavaScript value is less than another JavaScript value.
/// </summary>
/// <remarks>
/// <para>
/// This function is equivalent to the <c><</c> operator in Javascript.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <param name="object1">The first object to compare.</param>
/// <param name="object2">The second object to compare.</param>
/// <param name="result">Whether object1 is less than object2.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="object1" />
<Parameter type="JsValueRef" name="object2" />
<Parameter type="bool" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsLessThanOrEqual" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Determine if one JavaScript value is less than or equal to another JavaScript value.
/// </summary>
/// <remarks>
/// <para>
/// This function is equivalent to the <c><=</c> operator in Javascript.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <param name="object1">The first object to compare.</param>
/// <param name="object2">The second object to compare.</param>
/// <param name="result">Whether object1 is less than or equal to object2.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="object1" />
<Parameter type="JsValueRef" name="object2" />
<Parameter type="bool" name="result" direction="Out" />
</Parameters>
</Export>
<Export name="JsCreateExternalObjectWithPrototype" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Creates a new object (with prototype) that stores some external data.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="data">External data that the object will represent. May be null.</param>
/// <param name="finalizeCallback">
/// A callback for when the object is finalized. May be null.
/// </param>
/// <param name="prototype">Prototype object or nullptr.</param>
/// <param name="object">The new object.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="IntPtr" name="data" />
<Parameter type="JsFinalizeCallback" name="finalizeCallback" />
<Parameter type="JsValueRef" name="prototype" />
<Parameter type="JsValueRef" name="@object" direction="Out" />
</Parameters>
</Export>
<Export name="JsObjectGetProperty" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Gets an object's property.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="object">The object that contains the property.</param>
/// <param name="key">The key (JavascriptString or JavascriptSymbol) to the property.</param>
/// <param name="value">The value of the property.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="@object" />
<Parameter type="JsValueRef" name="key" />
<Parameter type="JsValueRef" name="value" direction="Out" />
</Parameters>
</Export>
<Export name="JsObjectSetProperty" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Puts an object's property.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="object">The object that contains the property.</param>
/// <param name="key">The key (JavascriptString or JavascriptSymbol) to the property.</param>
/// <param name="value">The new value of the property.</param>
/// <param name="useStrictRules">The property set should follow strict mode rules.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="@object" />
<Parameter type="JsValueRef" name="key" />
<Parameter type="JsValueRef" name="value" />
<Parameter type="bool" name="useStrictRules" />
</Parameters>
</Export>
<Export name="JsObjectHasProperty" target="Common" source="ChakraCore.h">
<Description>
<![CDATA[
/// <summary>
/// Determines whether an object has a property.
/// </summary>
/// <remarks>
/// Requires an active script context.
/// </remarks>
/// <param name="object">The object that may contain the property.</param>
/// <param name="key">The key (JavascriptString or JavascriptSymbol) to the property.</param>
/// <param name="hasProperty">Whether the object (or a prototype) has the property.</param>
/// <returns>
/// The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.
/// </returns>
]]>
</Description>
<Parameters>
<Parameter type="JsValueRef" name="@object" />
<Parameter type="JsValueRef" name="key" />
<Parameter type="bool" name="hasProperty" direction="Out" />