@agoric/xsnap 0.14.3-dev-b047af2.0 → 0.14.3-dev-3eb4230.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.
Files changed (126) hide show
  1. package/api.js +1 -1
  2. package/package.json +16 -23
  3. package/src/build.js +4 -61
  4. package/moddable/modules/data/base64/base64.js +0 -28
  5. package/moddable/modules/data/base64/manifest.json +0 -11
  6. package/moddable/modules/data/base64/modBase64.c +0 -188
  7. package/moddable/modules/data/binaryMessage/BinaryMessage.js +0 -106
  8. package/moddable/modules/data/crc/crc.c +0 -205
  9. package/moddable/modules/data/crc/crc.js +0 -36
  10. package/moddable/modules/data/crc/manifest.json +0 -8
  11. package/moddable/modules/data/hex/hex.js +0 -28
  12. package/moddable/modules/data/hex/manifest.json +0 -11
  13. package/moddable/modules/data/hex/modHex.c +0 -139
  14. package/moddable/modules/data/logical/logical.js +0 -32
  15. package/moddable/modules/data/logical/modLogical.c +0 -98
  16. package/moddable/modules/data/qrcode/manifest.json +0 -9
  17. package/moddable/modules/data/qrcode/qrcode.c +0 -93
  18. package/moddable/modules/data/qrcode/qrcode.js +0 -23
  19. package/moddable/modules/data/qrcode/qrcodegen.c +0 -1025
  20. package/moddable/modules/data/qrcode/qrcodegen.h +0 -267
  21. package/moddable/modules/data/text/decoder/manifest.json +0 -8
  22. package/moddable/modules/data/text/decoder/textdecoder.c +0 -480
  23. package/moddable/modules/data/text/decoder/textdecoder.js +0 -27
  24. package/moddable/modules/data/text/encoder/manifest.json +0 -8
  25. package/moddable/modules/data/text/encoder/textencoder.c +0 -232
  26. package/moddable/modules/data/text/encoder/textencoder.js +0 -24
  27. package/moddable/modules/data/tinyint/tinyint.c +0 -150
  28. package/moddable/modules/data/tinyint/tinyint.js +0 -53
  29. package/moddable/modules/data/url/manifest.json +0 -17
  30. package/moddable/modules/data/url/url.c +0 -1959
  31. package/moddable/modules/data/url/url.js +0 -210
  32. package/moddable/modules/data/wavreader/manifest.json +0 -8
  33. package/moddable/modules/data/wavreader/wavreader.js +0 -128
  34. package/moddable/modules/data/zlib/deflate.c +0 -161
  35. package/moddable/modules/data/zlib/deflate.js +0 -63
  36. package/moddable/modules/data/zlib/inflate.c +0 -145
  37. package/moddable/modules/data/zlib/inflate.js +0 -66
  38. package/moddable/modules/data/zlib/manifest_deflate.json +0 -9
  39. package/moddable/modules/data/zlib/manifest_inflate.json +0 -9
  40. package/moddable/modules/data/zlib/miniz.c +0 -4924
  41. package/moddable/xs/includes/xs.d.ts +0 -73
  42. package/moddable/xs/includes/xs.h +0 -1533
  43. package/moddable/xs/includes/xsmc.h +0 -206
  44. package/moddable/xs/makefiles/lin/makefile +0 -33
  45. package/moddable/xs/makefiles/lin/xsc.mk +0 -118
  46. package/moddable/xs/makefiles/lin/xsid.mk +0 -90
  47. package/moddable/xs/makefiles/lin/xsl.mk +0 -168
  48. package/moddable/xs/makefiles/lin/xst.mk +0 -201
  49. package/moddable/xs/makefiles/mac/makefile +0 -33
  50. package/moddable/xs/makefiles/mac/xsc.mk +0 -130
  51. package/moddable/xs/makefiles/mac/xsid.mk +0 -102
  52. package/moddable/xs/makefiles/mac/xsl.mk +0 -177
  53. package/moddable/xs/makefiles/mac/xst.mk +0 -203
  54. package/moddable/xs/makefiles/mac/xst_no_asan.txt +0 -52
  55. package/moddable/xs/makefiles/win/build.bat +0 -26
  56. package/moddable/xs/makefiles/win/xsc.mak +0 -142
  57. package/moddable/xs/makefiles/win/xsid.mak +0 -113
  58. package/moddable/xs/makefiles/win/xsl.mak +0 -186
  59. package/moddable/xs/makefiles/win/xst.mak +0 -195
  60. package/moddable/xs/platforms/lin_xs.h +0 -99
  61. package/moddable/xs/platforms/mac_xs.h +0 -97
  62. package/moddable/xs/platforms/wasm_xs.h +0 -79
  63. package/moddable/xs/platforms/win_xs.h +0 -104
  64. package/moddable/xs/platforms/xsHost.h +0 -63
  65. package/moddable/xs/platforms/xsPlatform.h +0 -618
  66. package/moddable/xs/sources/xsAPI.c +0 -2555
  67. package/moddable/xs/sources/xsAll.c +0 -294
  68. package/moddable/xs/sources/xsAll.h +0 -2741
  69. package/moddable/xs/sources/xsArguments.c +0 -222
  70. package/moddable/xs/sources/xsArray.c +0 -2657
  71. package/moddable/xs/sources/xsAtomics.c +0 -844
  72. package/moddable/xs/sources/xsBigInt.c +0 -1859
  73. package/moddable/xs/sources/xsBoolean.c +0 -109
  74. package/moddable/xs/sources/xsCode.c +0 -4493
  75. package/moddable/xs/sources/xsCommon.c +0 -1710
  76. package/moddable/xs/sources/xsCommon.h +0 -1142
  77. package/moddable/xs/sources/xsDataView.c +0 -2890
  78. package/moddable/xs/sources/xsDate.c +0 -1541
  79. package/moddable/xs/sources/xsDebug.c +0 -2710
  80. package/moddable/xs/sources/xsDefaults.c +0 -134
  81. package/moddable/xs/sources/xsError.c +0 -353
  82. package/moddable/xs/sources/xsFunction.c +0 -776
  83. package/moddable/xs/sources/xsGenerator.c +0 -865
  84. package/moddable/xs/sources/xsGlobal.c +0 -839
  85. package/moddable/xs/sources/xsJSON.c +0 -1091
  86. package/moddable/xs/sources/xsLexical.c +0 -1969
  87. package/moddable/xs/sources/xsLockdown.c +0 -933
  88. package/moddable/xs/sources/xsMapSet.c +0 -1649
  89. package/moddable/xs/sources/xsMarshall.c +0 -1020
  90. package/moddable/xs/sources/xsMath.c +0 -624
  91. package/moddable/xs/sources/xsMemory.c +0 -1941
  92. package/moddable/xs/sources/xsModule.c +0 -3101
  93. package/moddable/xs/sources/xsNumber.c +0 -560
  94. package/moddable/xs/sources/xsObject.c +0 -1102
  95. package/moddable/xs/sources/xsPlatforms.c +0 -480
  96. package/moddable/xs/sources/xsProfile.c +0 -577
  97. package/moddable/xs/sources/xsPromise.c +0 -1199
  98. package/moddable/xs/sources/xsProperty.c +0 -636
  99. package/moddable/xs/sources/xsProxy.c +0 -1014
  100. package/moddable/xs/sources/xsRegExp.c +0 -1168
  101. package/moddable/xs/sources/xsRun.c +0 -4889
  102. package/moddable/xs/sources/xsScope.c +0 -1293
  103. package/moddable/xs/sources/xsScript.c +0 -288
  104. package/moddable/xs/sources/xsScript.h +0 -1186
  105. package/moddable/xs/sources/xsSnapshot.c +0 -2161
  106. package/moddable/xs/sources/xsSnapshot.h +0 -51
  107. package/moddable/xs/sources/xsSourceMap.c +0 -218
  108. package/moddable/xs/sources/xsString.c +0 -3332
  109. package/moddable/xs/sources/xsSymbol.c +0 -503
  110. package/moddable/xs/sources/xsSyntaxical.c +0 -4193
  111. package/moddable/xs/sources/xsTree.c +0 -1893
  112. package/moddable/xs/sources/xsType.c +0 -1488
  113. package/moddable/xs/sources/xsdtoa.c +0 -6672
  114. package/moddable/xs/sources/xsmc.c +0 -340
  115. package/moddable/xs/sources/xsre.c +0 -7578
  116. package/xsnap-native/xsnap/makefiles/lin/makefile +0 -10
  117. package/xsnap-native/xsnap/makefiles/lin/xsnap-worker.mk +0 -153
  118. package/xsnap-native/xsnap/makefiles/lin/xsnap.mk +0 -144
  119. package/xsnap-native/xsnap/makefiles/mac/makefile +0 -10
  120. package/xsnap-native/xsnap/makefiles/mac/xsnap-worker.mk +0 -162
  121. package/xsnap-native/xsnap/makefiles/mac/xsnap.mk +0 -153
  122. package/xsnap-native/xsnap/sources/xsnap-worker.c +0 -996
  123. package/xsnap-native/xsnap/sources/xsnap.c +0 -716
  124. package/xsnap-native/xsnap/sources/xsnap.h +0 -142
  125. package/xsnap-native/xsnap/sources/xsnapPlatform.c +0 -1496
  126. package/xsnap-native/xsnap/sources/xsnapPlatform.h +0 -105
@@ -1,51 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-2018 Moddable Tech, Inc.
3
- *
4
- * This file is part of the Moddable SDK Runtime.
5
- *
6
- * The Moddable SDK Runtime is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU Lesser General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * The Moddable SDK Runtime is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public License
17
- * along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
18
- *
19
- */
20
-
21
- #include "xsAll.h"
22
- #include "xsScript.h"
23
-
24
- typedef struct sxProjection txProjection;
25
- typedef struct sxSnapshot txSnapshot;
26
-
27
- struct sxProjection {
28
- txProjection* nextProjection;
29
- txSlot* heap;
30
- txSlot* limit;
31
- size_t indexes[1];
32
- };
33
-
34
- struct sxSnapshot {
35
- char* signature;
36
- int signatureLength;
37
- txCallback* callbacks;
38
- int callbacksLength;
39
- int (*read)(void* stream, void* address, size_t size);
40
- int (*write)(void* stream, void* address, size_t size);
41
- void* stream;
42
- int error;
43
- txByte* firstChunk;
44
- txProjection* firstProjection;
45
- txSlot* firstSlot;
46
- txSize slotSize;
47
- txSlot** slots;
48
- };
49
-
50
- extern txMachine* fxReadSnapshot(txSnapshot* snapshot, txString theName, void* theContext);
51
- extern int fxWriteSnapshot(txMachine* the, txSnapshot* snapshot);
@@ -1,218 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-2022 Moddable Tech, Inc.
3
- *
4
- * This file is part of the Moddable SDK Runtime.
5
- *
6
- * The Moddable SDK Runtime is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU Lesser General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * The Moddable SDK Runtime is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU Lesser General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU Lesser General Public License
17
- * along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
18
- *
19
- * This file incorporates work covered by the following copyright and
20
- * permission notice:
21
- *
22
- * Copyright (C) 2010-2016 Marvell International Ltd.
23
- * Copyright (C) 2002-2010 Kinoma, Inc.
24
- *
25
- * Licensed under the Apache License, Version 2.0 (the "License");
26
- * you may not use this file except in compliance with the License.
27
- * You may obtain a copy of the License at
28
- *
29
- * http://www.apache.org/licenses/LICENSE-2.0
30
- *
31
- * Unless required by applicable law or agreed to in writing, software
32
- * distributed under the License is distributed on an "AS IS" BASIS,
33
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
- * See the License for the specific language governing permissions and
35
- * limitations under the License.
36
- */
37
-
38
- #include "xsScript.h"
39
-
40
- static void fxSourceMapLines(txParser* parser, txString mappings);
41
- static txInteger fxSourceMapValue(txParser* parser, txString* p);
42
-
43
- #define mxAssert(ASSERTION,MESSAGE) if (!(ASSERTION)) { fxReportParserError(parser, parser->line, MESSAGE); return; }
44
-
45
- void fxParserSourceMap(txParser* parser, void* theStream, txGetter theGetter, txUnsigned flags, txString* name)
46
- {
47
- txInteger line = parser->line;
48
- txNode* root = parser->root;
49
- txNode* object;
50
- txNode* item;
51
- txNode* node;
52
- txPropertyAtNode* property;
53
- txString id;
54
- txInteger version = 0;
55
- txString source = NULL;
56
- txString mappings = NULL;
57
-
58
- parser->line = 0;
59
- parser->root = NULL;
60
- parser->stream = theStream;
61
- parser->getter = theGetter;
62
-
63
- parser->line2 = 1;
64
- parser->crlf2 = 0;
65
- parser->escaped2 = 0;
66
- parser->integer2 = 0;
67
- parser->modifierLength2 = 0;
68
- parser->modifier2 = parser->emptyString;
69
- parser->number2 = 0;
70
- parser->stringLength2 = 0;
71
- parser->string2 = parser->emptyString;
72
- parser->symbol2 = C_NULL;
73
- parser->token2 = XS_NO_TOKEN;
74
-
75
- parser->lookahead = 0;
76
- #if mxCESU8
77
- parser->surrogate = 0;
78
- #endif
79
- fxGetNextCharacter(parser);
80
- fxGetNextCharacter(parser);
81
- fxGetNextTokenJSON(parser);
82
- fxGetNextTokenJSON(parser);
83
- fxJSONValue(parser);
84
- if (parser->errorCount)
85
- return;
86
- object = parser->root;
87
- parser->line = line;
88
- parser->root = root;
89
-
90
- mxAssert(object->description->token == XS_TOKEN_OBJECT, "source map: no object");
91
- mxAssert(((txObjectNode*)object)->items, "source map: no properties");
92
- item = ((txObjectNode*)object)->items->first;
93
- while (item) {
94
- mxAssert(item->description->token == XS_TOKEN_PROPERTY_AT, "source map: no property");
95
- property = (txPropertyAtNode*)item;
96
- mxAssert(property->at->description->token == XS_TOKEN_STRING, "source map: no property name");
97
- id = ((txStringNode*)(property->at))->value;
98
- if (!c_strcmp(id, "version")) {
99
- mxAssert(property->value->description->token == XS_TOKEN_INTEGER, "source map: version is no integer");
100
- version = ((txIntegerNode*)(property->value))->value;
101
- }
102
- else if (!c_strcmp(id, "sources")) {
103
- mxAssert(property->value->description->token == XS_TOKEN_ARRAY, "source map: sources is no array");
104
- node = ((txArrayNode*)(property->value))->items->first;
105
- mxAssert(node->description->token == XS_TOKEN_STRING, "source map: sources[0] is no string");
106
- source = ((txStringNode*)(node))->value;
107
- }
108
- else if (!c_strcmp(id, "mappings")) {
109
- mxAssert(property->value->description->token == XS_TOKEN_STRING, "source map: mappings is no string");
110
- mappings = ((txStringNode*)(property->value))->value;
111
- }
112
- item = item->next;
113
- }
114
- mxAssert(version == 3, "source map: version is not 3");
115
- mxAssert(source, "source map: no source");
116
- mxAssert(mappings, "source map: no mappings");
117
-
118
- parser->lines = fxNewParserChunkClear(parser, (1 + line) * sizeof(txInteger));
119
-
120
- fxSourceMapLines(parser, mappings);
121
- *name = source;
122
- }
123
-
124
- void fxSourceMapLines(txParser* parser, txString mappings)
125
- {
126
- enum { BEGIN, SOURCE, LINE, COLUMN, NAME, END };
127
- txInteger generatedLine = 0;
128
- // txInteger generatedColumn = 0;
129
- // txInteger name = 0;
130
- // txInteger source = 0;
131
- txInteger sourceLine = 0;
132
- // txInteger sourceColumn = 0;
133
- txInteger state = BEGIN;
134
- txString p = mappings;
135
- char c;
136
- while ((c = *p)) {
137
- if (c == ';') {
138
- p++;
139
- if ((state >= NAME) && (generatedLine < parser->line))
140
- parser->lines[1 + generatedLine] = 1 + sourceLine;
141
- generatedLine++;
142
- // generatedColumn = 0;
143
- state = BEGIN;
144
- }
145
- else if (c == ',') {
146
- p++;
147
- if ((state >= NAME) && (generatedLine < parser->line))
148
- parser->lines[1 + generatedLine] = 1 + sourceLine;
149
- state = BEGIN;
150
- }
151
- else {
152
- txInteger value = fxSourceMapValue(parser, &p);
153
- switch(state) {
154
- case BEGIN:
155
- // generatedColumn += value;
156
- state = SOURCE;
157
- break;
158
- case SOURCE:
159
- // source += value;
160
- state = LINE;
161
- break;
162
- case LINE:
163
- sourceLine += value;
164
- state = COLUMN;
165
- break;
166
- case COLUMN:
167
- // sourceColumn += value;
168
- state = NAME;
169
- break;
170
- case NAME:
171
- // name += value;
172
- state = END;
173
- break;
174
- }
175
- }
176
- }
177
- }
178
-
179
- #define VLQ_SHIFT 5
180
- // binary: 100000
181
- #define VLQ_CONTINUATION_BIT (1 << VLQ_SHIFT)
182
- // binary: 011111
183
- #define VLQ_MASK_BITS (VLQ_CONTINUATION_BIT - 1)
184
-
185
- txInteger fxSourceMapValue(txParser* parser, txString* p)
186
- {
187
- txInteger continuation, digit, result = 0, shift = 0;
188
- txString q = *p;
189
- do {
190
- char c = *q++;
191
- if (('A' <= c) && (c <= 'Z'))
192
- digit = c - 'A';
193
- else if (('a' <= c) && (c <= 'z'))
194
- digit = c - 'a' + 26;
195
- else if (('0' <= c) && (c <= '9'))
196
- digit = c - '0' + 52;
197
- else if (c == '+')
198
- digit = 62;
199
- else if (c == '/')
200
- digit = 63;
201
- else
202
- fxReportParserError(parser, parser->line, "source map: unexpected character");
203
- continuation = digit & VLQ_CONTINUATION_BIT;
204
- digit &= VLQ_MASK_BITS;
205
- result += (digit << shift);
206
- shift += VLQ_SHIFT;
207
- } while (continuation);
208
- *p = q;
209
- shift = result >> 1;
210
- return ((result & 1) == 1) ? -shift : shift;
211
- }
212
-
213
-
214
-
215
-
216
-
217
-
218
-