UNPKG

shift-interpreter

Version:

Shift-interpreter is an experimental JavaScript meta-interpreter useful for reverse engineering and analysis. One notable difference from other projects is that shift-interpreter retains state over an entire script but can be fed expressions and statement

11 lines (9 loc) 396 B
import { compare, assertResult } from '../util'; describe('UpdateExpression', () => { it('should evaluate operators the same as the host environment', () => { assertResult(compare(`let a = 0; let b = a++; b`)); assertResult(compare(`let a = 0; let b = ++a; b`)); assertResult(compare(`let a = 0; let b = a--; b`)); assertResult(compare(`let a = 0; let b = --a; b`)); }); });