@tlua/tlua-darwin-arm64 0.0.39 → 0.0.40
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/lib/lib.luajit.d.tlua +14 -1
- package/lib/tlua +0 -0
- package/package.json +2 -2
package/lib/lib.luajit.d.tlua
CHANGED
|
@@ -191,6 +191,10 @@ declare function xpcall(fn: function, handler: (message: any) => any, ...: any):
|
|
|
191
191
|
* generic `T`. The whole coroutine module stays erased: resume/yield because a
|
|
192
192
|
* `thread` is opaque and carries no packs (Luau makes the same call), and wrap
|
|
193
193
|
* because a wrapped call exchanges values with `yield`, not with fn's packs.
|
|
194
|
+
* That erasure is about packs only -- `coroutine.yield` still carries the suspend
|
|
195
|
+
* flag, because it is the primitive the whole contract is founded on. `resume`
|
|
196
|
+
* and a wrapped function do not: driving a coroutine from ordinary code is what
|
|
197
|
+
* they are for.
|
|
194
198
|
*
|
|
195
199
|
* The signatures of setmetatable and getmetatable stay deliberately plain: the
|
|
196
200
|
* checker pairs a table with its metatable itself. A call to the *global*
|
|
@@ -224,7 +228,16 @@ interface CoroutineLib {
|
|
|
224
228
|
// parameter/return packs would assert types that are wrong for every coroutine
|
|
225
229
|
// that yields, which is what wrap is for.
|
|
226
230
|
wrap(fn: function): function;
|
|
227
|
-
yield
|
|
231
|
+
// `yield` is the primitive that actually suspends the running coroutine, so
|
|
232
|
+
// it anchors the suspend contract: everything else marked `suspend` is marked
|
|
233
|
+
// by hand, and this is the one signature the contract can be founded on. A
|
|
234
|
+
// function whose body yields must therefore declare itself `suspend`, and a
|
|
235
|
+
// yield reached from ordinary code -- the runtime's "attempt to yield from
|
|
236
|
+
// outside a coroutine" -- is a diagnostic instead. The `suspend` modifier is
|
|
237
|
+
// illegal in an ambient context, so this is a property carrying a suspend
|
|
238
|
+
// function *type*; the argument and result types stay erased exactly as
|
|
239
|
+
// resume's do. Widening to the `function` top type is the escape hatch.
|
|
240
|
+
yield: suspend (...: any) => (any?, ...any);
|
|
228
241
|
}
|
|
229
242
|
|
|
230
243
|
declare coroutine: CoroutineLib;
|
package/lib/tlua
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tlua/tlua-darwin-arm64",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "tlua",
|
|
6
6
|
"homepage": "https://github.com/apyrr/tlua",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"exports": {
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "f31116b7dc888e8bd7156171bc2027703f38ae09",
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public",
|
|
38
38
|
"tag": "latest"
|