All Projects → axetroy → Vm.js

axetroy / Vm.js

Licence: mit
Javascript 解释器. Javascript Interpreter

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Vm.js

quickjs-build
Build for QuickJS JavaScript Engine
Stars: ✭ 25 (-92.71%)
Mutual labels:  vm, interpreter
Passerine
A small extensible programming language designed for concise expression with little code.
Stars: ✭ 341 (-0.58%)
Mutual labels:  interpreter, vm
AlchemyVM
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 184 (-46.36%)
Mutual labels:  vm, interpreter
clox
A virtual machine and a tree-walk interpreter for the Lox programming language in C89 🌀
Stars: ✭ 38 (-88.92%)
Mutual labels:  vm, interpreter
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (-90.67%)
Mutual labels:  vm, interpreter
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 101 (-70.55%)
Mutual labels:  vm, interpreter
Animach
Scheme语言实现和运行时环境 / A Scheme runtime & implementation
Stars: ✭ 45 (-86.88%)
Mutual labels:  vm, interpreter
Quickjs
The official repo is at bellard/quickjs.
Stars: ✭ 1,429 (+316.62%)
Mutual labels:  interpreter, vm
retro12
This repo is retired. See http://forthworks.com:8000/
Stars: ✭ 18 (-94.75%)
Mutual labels:  vm, interpreter
go-jdk
Run JVM-based code in Go efficiently
Stars: ✭ 61 (-82.22%)
Mutual labels:  vm, interpreter
Alchemyvm
WebAssembly Virtual Machine Built In Elixir
Stars: ✭ 176 (-48.69%)
Mutual labels:  interpreter, vm
RISVM
A low overhead, embeddable bytecode virtual machine in C++
Stars: ✭ 21 (-93.88%)
Mutual labels:  vm, interpreter
Janet
A dynamic language and bytecode vm
Stars: ✭ 2,216 (+546.06%)
Mutual labels:  interpreter, vm
pocketlang
A lightweight, fast embeddable scripting language.
Stars: ✭ 1,412 (+311.66%)
Mutual labels:  vm, interpreter
Javo
🚀 A sandboxed VM any Java developer can afford
Stars: ✭ 144 (-58.02%)
Mutual labels:  interpreter, vm
RSqueak
A Squeak/Smalltalk VM written in RPython.
Stars: ✭ 78 (-77.26%)
Mutual labels:  vm, interpreter
Q3vm
Q3VM - Single file (vm.c) bytecode virtual machine/interpreter for C-language input
Stars: ✭ 585 (+70.55%)
Mutual labels:  interpreter, vm
Zetavm
Multi-Language Platform for Dynamic Programming Languages
Stars: ✭ 592 (+72.59%)
Mutual labels:  interpreter, vm
snap
An embeddable scripting language inspired by Lua and JavaScript.
Stars: ✭ 32 (-90.67%)
Mutual labels:  vm, interpreter
SandboxJS
Safe eval runtime
Stars: ✭ 18 (-94.75%)
Mutual labels:  vm, interpreter

vm.js

Build Status Coverage Status DeepScan grade License Prettier Node npm version Size

Run Javascript code in ECMAScript, without eval(), new Function(), setTimeout()...

It base on https://github.com/bramblex/jsjs

Try it out

Usage

import vm from "@axetroy/vm";

const sanbox = { console: console };

const context = vm.createContext(sanbox);

try {
  vm.runInContext(`console.log("Hello world");`, context);
} catch (err) {
  console.error(err);
}

Support

  • [x] ECMA5
  • [x] ES2015
    • [x] Let and const
    • [x] Block scoping
    • [x] ES modules
    • [x] Arrow functions
    • [x] Class
    • [x] Computed properties
    • [x] Destructuring
    • [x] For of
    • [x] Function/Class name
    • [x] Literals
    • [x] Object super
    • [x] Default and rest parameters
    • [x] Shorthand properties
    • [x] Spread
    • [x] Template literals
    • [x] Lifting template literal restriction
    • [ ] Unicode-regex
    • [x] Generator function
  • [ ] ES2016
    • [x] Exponentiation operator
  • [ ] ES2017
    • [x] Trailing commas in function parameter lists and calls
    • [ ] Async functions
    • [ ] Shared memory and atomics
  • [ ] ES2018
    • [ ] Asynchronous iteration
    • [ ] Promise.prototype.finally()
    • [ ] s (dotAll) flag for regular expressions
    • [ ] RegExp named capture groups
    • [ ] RegExp Unicode Property Escapes
  • [ ] Experimental

Test

I have written a lot of test case for this, look at here

Now it still in development, got a lot of work to do and more detail to resolve.

I will release the first stable version of write 500 test case.

If you want to join it. welcome to PR.

How to run a single test

npx tsc && npx ava ./build/test/ecma5/array/

How to run the whole test

npm run test

Related

bramblex/jsjs

jkeylu/evil-eval

License

The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].