paulbartrum/jurassic

A .NET library to parse and execute JavaScript code.

C#

950

592 commits

updated Feb 4, 2025

See the code

README

Jurassic

Build status

What is Jurassic?

Jurassic is an implementation of the ECMAScript language and runtime. It aims to provide the best performing and most standards-compliant implementation of JavaScript for .NET. Jurassic is not intended for end-users; instead it is intended to be integrated into .NET programs. If you are the author of a .NET program, you can use Jurassic to compile and execute JavaScript code.

Features

  • Supports all ECMAScript 3 and ECMAScript 5 functionality, including ES5 strict mode
  • Well tested - passes over five thousand unit tests (with over thirty thousand asserts)
  • Simple yet powerful API
  • Compiles JavaScript into .NET bytecode (CIL); not an interpreter
  • Deployed as a single .NET assembly (no native code)
  • Basic support for integrated debugging within Visual Studio
  • Uses light-weight code generation, so generated code is fully garbage collected
  • Tested on .NET 3.5, .NET 4 and Silverlight

How do I get it?

Install the NuGet package.

Usage

See the wiki for full usage details.

ECMAScript 6 status

Support for ECMAScript 6 is in progress. See http://kangax.github.io/compat-table/es6/ for the definition of each feature. The table below is correct as of version 3.1.

FeatureStatus
Optimisation
  proper tail calls (tail call optimisation)❌
Syntax
  default function parameters4/7
  rest parameters❌
  spread syntax for iterable objects❌
  object literal extensions✅ 6/6
  for..of loops6/9
  octal and binary literals✅ 4/4
  template literals6/7
  RegExp "y" and "u" flags❌
  destructuring, declarations❌
  destructuring, assignment❌
  destructuring, parameters❌
  Unicode code point escapes✅ 4/4
  new.target✅ 2/2
Bindings
  const✅ 18/18
  let14/16
  block-level function declaration[18]❌
Functions
  arrow functions❌
  class✅ 24/24
  super✅ 8/8
  generators❌
Built-ins
  typed arrays45/46
  Map18/19
  Set18/19
  WeakMap11/12
  WeakSet10/11
  Proxy [25]33/34
  Reflect [26]18/20
  Promise4/8
  Symbol✅ 12/12
  well-known symbols[27]23/26
Built-in extensions
  Object static methods✅ 4/4
  function "name" property10/17
  String static methods✅ 2/2
  String.prototype methods✅ 10/10
  RegExp.prototype properties✅ 6/6
  Array static methods8/11
  Array.prototype methods✅ 10/10
  Number properties✅ 9/9
  Math methods✅ 17/17
  Date.prototype[Symbol.toPrimitive]✅ 1/1
Subclassing
  Array is subclassable9/11
  RegExp is subclassable✅ 4/4
  Function is subclassable4/6
  Promise is subclassable❌
  miscellaneous subclassables❌
Misc
  prototype of bound functions1/5
  Proxy, internal 'get' calls19/36
  Proxy, internal 'set' calls7/11
  Proxy, internal 'defineProperty' calls❌
  Proxy, internal 'deleteProperty' calls❌
  Proxy, internal 'getOwnPropertyDescriptor' calls2/4
  Proxy, internal 'ownKeys' calls✅ 3/3
  Object static methods accept primitives✅ 10/10
  own property order5/7
  Updated identifier syntax1/3
  miscellaneous8/9
Annex b
  non-strict function semantics[35]2/3
  __proto__ in object literals [36]❌
  Object.prototype.__proto__1/6
  String.prototype HTML methods✅ 3/3
  RegExp.prototype.compile1/2
  RegExp syntax extensions4/8
  HTML-style comments❌
compiler
javascript
library

paulbartrum/jurassic

A .NET library to parse and execute JavaScript code.

C#

950

592 commits

updated Feb 4, 2025

See the code

README

Jurassic

Build status

What is Jurassic?

Jurassic is an implementation of the ECMAScript language and runtime. It aims to provide the best performing and most standards-compliant implementation of JavaScript for .NET. Jurassic is not intended for end-users; instead it is intended to be integrated into .NET programs. If you are the author of a .NET program, you can use Jurassic to compile and execute JavaScript code.

Features

  • Supports all ECMAScript 3 and ECMAScript 5 functionality, including ES5 strict mode
  • Well tested - passes over five thousand unit tests (with over thirty thousand asserts)
  • Simple yet powerful API
  • Compiles JavaScript into .NET bytecode (CIL); not an interpreter
  • Deployed as a single .NET assembly (no native code)
  • Basic support for integrated debugging within Visual Studio
  • Uses light-weight code generation, so generated code is fully garbage collected
  • Tested on .NET 3.5, .NET 4 and Silverlight

How do I get it?

Install the NuGet package.

Usage

See the wiki for full usage details.

ECMAScript 6 status

Support for ECMAScript 6 is in progress. See http://kangax.github.io/compat-table/es6/ for the definition of each feature. The table below is correct as of version 3.1.

FeatureStatus
Optimisation
  proper tail calls (tail call optimisation)❌
Syntax
  default function parameters4/7
  rest parameters❌
  spread syntax for iterable objects❌
  object literal extensions✅ 6/6
  for..of loops6/9
  octal and binary literals✅ 4/4
  template literals6/7
  RegExp "y" and "u" flags❌
  destructuring, declarations❌
  destructuring, assignment❌
  destructuring, parameters❌
  Unicode code point escapes✅ 4/4
  new.target✅ 2/2
Bindings
  const✅ 18/18
  let14/16
  block-level function declaration[18]❌
Functions
  arrow functions❌
  class✅ 24/24
  super✅ 8/8
  generators❌
Built-ins
  typed arrays45/46
  Map18/19
  Set18/19
  WeakMap11/12
  WeakSet10/11
  Proxy [25]33/34
  Reflect [26]18/20
  Promise4/8
  Symbol✅ 12/12
  well-known symbols[27]23/26
Built-in extensions
  Object static methods✅ 4/4
  function "name" property10/17
  String static methods✅ 2/2
  String.prototype methods✅ 10/10
  RegExp.prototype properties✅ 6/6
  Array static methods8/11
  Array.prototype methods✅ 10/10
  Number properties✅ 9/9
  Math methods✅ 17/17
  Date.prototype[Symbol.toPrimitive]✅ 1/1
Subclassing
  Array is subclassable9/11
  RegExp is subclassable✅ 4/4
  Function is subclassable4/6
  Promise is subclassable❌
  miscellaneous subclassables❌
Misc
  prototype of bound functions1/5
  Proxy, internal 'get' calls19/36
  Proxy, internal 'set' calls7/11
  Proxy, internal 'defineProperty' calls❌
  Proxy, internal 'deleteProperty' calls❌
  Proxy, internal 'getOwnPropertyDescriptor' calls2/4
  Proxy, internal 'ownKeys' calls✅ 3/3
  Object static methods accept primitives✅ 10/10
  own property order5/7
  Updated identifier syntax1/3
  miscellaneous8/9
Annex b
  non-strict function semantics[35]2/3
  __proto__ in object literals [36]❌
  Object.prototype.__proto__1/6
  String.prototype HTML methods✅ 3/3
  RegExp.prototype.compile1/2
  RegExp syntax extensions4/8
  HTML-style comments❌
compiler
javascript
library

Project health

Overall

2.7/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

3.2.9 · Feb 4, 2025

Releases this year

0

Significant stargazers

Konstantin Tarkus

805 followers · starred Jun 2016

Hadrian Tang

107 followers · starred Mar 2018

Kirill Osenkov

1,319 followers · starred Jan 2026

David Gardiner

96 followers · starred Aug 2017