diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-29 15:35:46 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-29 15:35:46 +1000 |
commit | 6d1484d41f5b5d561d21d6e497bd1ec437973464 (patch) | |
tree | 05db2d4ed395c04f2e658be340296870ed41d944 /src/lobject.js | |
parent | bc7396f76988347bb5870e8482d17ee33f808ad7 (diff) | |
download | fengari-6d1484d41f5b5d561d21d6e497bd1ec437973464.tar.gz fengari-6d1484d41f5b5d561d21d6e497bd1ec437973464.tar.bz2 fengari-6d1484d41f5b5d561d21d6e497bd1ec437973464.zip |
src/lfunc.js: Give UpVals an id field
This way they have an id when printed via %p. e.g.
`debug.upvalueid(function() print() end, 1)`
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lobject.js b/src/lobject.js index db76cb5..44d8c9b 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -7,6 +7,7 @@ const defs = require('./defs.js'); const ljstype = require('./ljstype.js'); const ldebug = require('./ldebug.js'); const ldo = require('./ldo.js'); +const lfunc = require('./lfunc.js'); const lstate = require('./lstate.js'); const lstring = require('./lstring.js'); const ltable = require('./ltable.js'); @@ -577,7 +578,8 @@ const luaO_pushvfstring = function(L, fmt, argp) { v instanceof ltable.Table || v instanceof Udata || v instanceof LClosure || - v instanceof CClosure) { + v instanceof CClosure || + v instanceof lfunc.UpVal) { pushstr(L, defs.to_luastring("0x"+v.id.toString(16))); } else { /* user provided object. no id available */ |