MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / isEnv

Function isEnv

lib/lua/src/ldebug.c:552–560  ·  view source on GitHub ↗

** Check whether table being indexed by instruction 'i' is the ** environment '_ENV' */

Source from the content-addressed store, hash-verified

550** environment '_ENV'
551*/
552static const char *isEnv (const Proto *p, int pc, Instruction i, int isup) {
553 int t = GETARG_B(i); /* table index */
554 const char *name; /* name of indexed variable */
555 if (isup) /* is 't' an upvalue? */
556 name = upvalname(p, t);
557 else /* 't' is a register */
558 basicgetobjname(p, &pc, t, &name);
559 return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field";
560}
561
562
563/*

Callers 1

getobjnameFunction · 0.85

Calls 2

upvalnameFunction · 0.85
basicgetobjnameFunction · 0.85

Tested by

no test coverage detected