script: isolate initialization of REVERSE_OPS
This commit is contained in:
parent
74c2f1d957
commit
5be9b04741
1 changed files with 8 additions and 5 deletions
|
@ -4,11 +4,14 @@ var typeforce = require('typeforce')
|
|||
var types = require('./types')
|
||||
|
||||
var OPS = require('./opcodes')
|
||||
var REVERSE_OPS = []
|
||||
for (var op in OPS) {
|
||||
var code = OPS[op]
|
||||
REVERSE_OPS[code] = op
|
||||
}
|
||||
var REVERSE_OPS = (function () {
|
||||
var result = {}
|
||||
for (var op in OPS) {
|
||||
var code = OPS[op]
|
||||
result[code] = op
|
||||
}
|
||||
return result
|
||||
})()
|
||||
|
||||
function toASM (chunks) {
|
||||
if (types.Buffer(chunks)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue