SkillAgentSearch skills...

Jsvm2

Javascript Interpreter implemented by typescript(TS实现的JS解释器)

Install / Use

/learn @ximing/Jsvm2
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

build workflow Coverage Status NPM npm bundle size

Specification

https://www.ecma-international.org/wp-content/uploads/ECMA-262_5th_edition_december_2009.pdf

使用方法

npm i -S jsvm2

参考 tests/helper.ts

语法支持情况

注:引擎表现为严格模式

ES5

  • [x] File
  • [x] Program
  • [x] Identifier
  • [x] NullLiteral
  • [x] StringLiteral
  • [x] NumericLiteral
  • [x] BooleanLiteral
  • [x] RegExpLiteral
  • [x] VariableDeclaration
  • [x] FunctionDeclaration
  • [x] FunctionExpression
  • [x] ArrayExpression
  • [x] VariableDeclarator
  • [x] ExpressionStatement
  • [x] BlockStatement
  • [x] ConditionalExpression
  • [x] EmptyStatement
  • [x] DebuggerStatement
  • [ ] WithStatement: t.WithStatement; // 不实现,@babel/parse 在严格模式下禁用 WithStatement
  • [x] ReturnStatement
  • [x] LabeledStatement
  • [x] BreakStatement
  • [x] ContinueStatement
  • [x] IfStatement
  • [x] SwitchStatement
  • [x] SwitchCase
  • [x] ThrowStatement
  • [x] TryStatement
  • [x] CatchClause
  • [x] ForStatement
  • [x] WhileStatement
  • [x] DoWhileStatement
  • [x] ForInStatement
  • [x] ThisExpression
  • [x] ObjectExpression
  • [x] ObjectProperty
  • [x] ObjectMethod
  • [x] UnaryExpression
  • [x] UpdateExpression
  • [x] BinaryExpression
  • [x] AssignmentExpression
  • [x] LogicalExpression
  • [x] MemberExpression
  • [x] CallExpression
  • [x] NewExpression
  • [x] SequenceExpression

ES2015

  • [x] VariableDeclaration (let/const)
  • [x] ArrowFunctionExpression
  • [ ] TemplateLiteral
  • [ ] TaggedTemplateExpression
  • [x] ForOfStatement
  • [ ] ClassDeclaration
  • [ ] ClassExpression
  • [ ] ClassBody
  • [ ] ClassMethod
  • [x] MetaProperty
  • [ ] Super
  • [ ] TemplateElement
  • [x] SpreadElement
  • [ ] YieldExpression
  • [x] ObjectPattern
  • [ ] ArrayPattern
  • [x] RestElement
  • [x] AssignmentPattern
  • [ ] ImportDeclaration
  • [ ] ExportNamedDeclaration
  • [ ] ExportDefaultDeclaration

ES2016

  • [x] BinaryExpression

ES2017

  • [ ] AwaitExpression

Experimental

  • [ ] ImportSpecifier
  • [ ] ImportDefaultSpecifier
  • [ ] ExportSpecifier
  • [ ] SpreadProperty
  • [ ] DoExpression
  • [ ]Decorator

Test

View on GitHub
GitHub Stars8
CategoryDevelopment
Updated3mo ago
Forks1

Languages

JavaScript

Security Score

72/100

Audited on Jan 1, 2026

No findings