Skip to content

Commit caded06

Browse files
authored
Merge pull request #23 from sUNC-Utilities/upvalue-correction
Clarify reasons for not supporting upvalues on C closures
2 parents 119a800 + 5f416c5 commit caded06

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/Debug/getupvalue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!!! warning "C closures are not supported"
44

5-
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), since C closures do not expose upvalues.
5+
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), for security reasons.
66

77
`#!luau debug.getupvalue` returns the upvalue at the specified index from a Luau function's closure. If the index is invalid or out of bounds, an error will occur.
88

docs/Debug/getupvalues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!!! warning "C closures are not supported"
44

5-
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), since C closures do not expose upvalues.
5+
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), for security reasons.
66

77
`#!luau debug.getupvalues` returns a list of upvalues captured by a Luau function. These are the external variables that a function closes over from its surrounding scope.
88

docs/Debug/setupvalue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!!! warning "C closures not supported"
44

5-
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), since C closures do not expose upvalues.
5+
This function will throw an error if called on a C closure, such as [`#!luau print`](https://create.roblox.com/docs/reference/engine/globals/LuaGlobals#print), for security reasons.
66

77
`#!luau debug.setupvalue` replaces an upvalue at the specified index in a Luau function, with a new value.
88

0 commit comments

Comments
 (0)