-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Guard against overwiting function table for #1100 * set new slot to false as suggested by @zauguin * change log for #1100
- Loading branch information
1 parent
163a10b
commit 3f41c4d
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
This is a generated file for the LaTeX2e validation system. | ||
Don't change this file in any respect. | ||
> \fone=expandable luacall 25. | ||
l. ...\show\fone | ||
Lua function ftwo = ... | ||
> \ftwo=expandable luacall 26. | ||
l. ...\show\ftwo | ||
f1: FUNCTION 1 | ||
f2: FUNCTION 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
\input test2e | ||
% github issue 1100 | ||
\START | ||
\ifx\directlua\undefined | ||
\expandafter\END | ||
\fi | ||
|
||
\directlua{ | ||
local lft = lua.get_functions_table() | ||
lft[\string#lft+1] = function() | ||
tex.sprint(-2, "FUNCTION 1") | ||
end | ||
token.set_lua("fone", \string#lft, "global") | ||
} | ||
|
||
\show\fone | ||
|
||
\directlua{ | ||
local func = luatexbase.new_luafunction('ftwo') | ||
token.set_lua('ftwo', func) | ||
lua.get_functions_table()[func] = function() | ||
tex.sprint(-2, "FUNCTION 2") | ||
end | ||
} | ||
|
||
% should not be same as fone | ||
\show\ftwo | ||
|
||
\typeout{f1: \fone} | ||
\typeout{f2: \ftwo} | ||
|
||
\END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This is a generated file for the LaTeX2e validation system. | ||
Don't change this file in any respect. |