MCPcopy Create free account
hub / github.com/aesthetic0001/js-virtualizer / loadFromString

Method loadFromString

src/vm_dev.js:110–123  ·  view source on GitHub ↗
(code, format)

Source from the content-addressed store, hash-verified

108 }
109
110 loadFromString(code, format) {
111 if (!format) {
112 // assume buffer
113 this.code = code
114 return
115 }
116 const buffer = Buffer.from(code, format)
117 if (buffer[0] === 0x78 && buffer[1] === 0x9c) {
118 log(new LogData("Decompressing zlib compressed bytecode", 'accent', true))
119 this.code = zlib.inflateSync(buffer)
120 } else {
121 this.code = buffer
122 }
123 }
124
125 loadDependencies(dependencies) {
126 Object.keys(dependencies).forEach((key) => {

Callers 5

loaders.test.jsFile · 0.45
branching.test.jsFile · 0.45
vfunc.test.jsFile · 0.45
try_catch.test.jsFile · 0.45
math.test.jsFile · 0.45

Calls 2

logFunction · 0.85
fromMethod · 0.80

Tested by

no test coverage detected