JavaScript restrictions

A heavy set of restrictions are imposed on user code that can be executed by the interpreter. This allows to make the runtime as simple to implement and reason about as possible. The following restrictions are non-normative and being worked on pending the result of proof of concepts implemented in various host programming languages.

Mandatory

Whitespace and comments

if-else

while

for-in

function definition and return

read from standard input

reading contents of a file

writing contents to a file

document.cookie

Call stack quota

Heap allocation quota

CPU time quota

Quality of life improvement

Array object

window.localStorage

Pause, resume and terminate script upon interactive command

Pure anonymous function expression

Nested function definition

short-circuiting operators &&, ||

eval

Strict equality === !==

document.write

reading the value of a form input element

Consecutive terms of same operator in expressions

Automatic ToBoolean conversion

To research

Abstract equality == !=

Floating point numbers

Automatic ToString conversion

Unicode

Operator precedence in expressions

Booleans

Date

RegExp

https://en.wikipedia.org/wiki/ReDoS

Partial

semicolon

write to standard output

block scope braces

Immediately invoked anonymous function expression

Environment capturing by a function definition

Variable initializer

Exceptions try-catch, throw

Field accessor chaining

window.location.href

window.location.replace

window.location.assign

window.setTimeout

form post

XMLHttpRequest

Automatic ToNumber conversion

Instantiate class with new keyword

Unsupported

Automatic ToPrimitive conversion

Constructor arguments

window.setInterval

writing to the value of a form input element

variable declaration hoisting

do-while

for

break, continue

varargs

block scope environment const, let

switch-case-default

Literal object notation

Literal array notation

Reference cycles

Tail call optimization

Prototype

Standards

Navigation