Undecided Constructs

Status: open, a decision owed for each row

These constructs are not decided yet. Each is valid JavaScript that fjs compile refuses today, and no record says whether it stays out of FunctionalScript or comes in. The demo below lists them all, with what the compiler prints for each.

The refused constructs register gives every refusal a Why: design when it is meant to last, as for ==; planned when a record proposes admitting it; and open when only the whitelist refuses it. This page is the open rows, the ones still waiting for a language designer's decision.

Examples

The demo fetches the register and keeps its open rows, so it lists what the register says on this build, with nothing here to keep in step. For each row it shows the register's construct and the record it names, if any, and compiles a small module that writes the construct, from samples.f.js, named after the row's ID. It says so when the compiler accepts a sample, when an open row has no sample, or when a sample's row is no longer open, since each means the page and the register no longer agree.

The proof checks that every sample is refused, and where and with which message, so each one pins its row's refusal as the register asks: a refusal that moves, or changes its message, fails it.

When a Row Is Decided

The pull request that decides a row changes its Why in the register, and the row leaves this page with it. The same pull request removes the row's sample here, and the construct gets a page of its own: a refused construct's page, like ==, when it stays out, or the feature's page in the specification when it comes in.

Reference

Demo

Not decided yet

Each construct below is valid JavaScript that fjs compile refuses today, while no record says whether it stays out of FunctionalScript or comes in.

35 open rows: 34 refused today, 0 accepted, 1 without a sample.

lex.trivia

Construct:

VT, FF, U+FEFF (a leading byte order mark included), NBSP and the other space separators such as U+3000; U+2028 or U+2029 outside a string

Related:

the roadmap asks that each be recognized or its refusal justified; whitespace

lex.trivia.mjs:

export default1;

What fjs compile prints:

lex.trivia.mjs:1:15-2:1 - error: unexpected token
1 | export default1;
  |               ^

op.comma

Construct:

return a, b, throw a, b, if (a, b), ${a, b}, o[a, b] — a comma JavaScript reads with no parentheses of its own

Related:

comma admits it in parentheses, return (a, b); no record plans the bare spellings

op.comma.mjs:

const f = a => { return a, 1; };
export default f(0);

What fjs compile prints:

op.comma.mjs:1:26 - error: unexpected token
1 | const f = a => { return a, 1; };
  |                          ^

op.delete

Construct:

delete a.b

op.delete.mjs:

const o = { a: 1 };
export default delete o.a;

What fjs compile prints:

op.delete.mjs:2:23 - error: unexpected token
2 | export default delete o.a;
  |                       ^

op.void

Construct:

void 0

op.void.mjs:

export default void 0;

What fjs compile prints:

op.void.mjs:1:21 - error: unexpected token
1 | export default void 0;
  |                     ^

op.arguments

Construct:

arguments

op.arguments.mjs:

export default typeof arguments;

What fjs compile prints:

op.arguments.mjs:1:23 - error: reserved word
1 | export default typeof arguments;
  |                       ^

op.unary-plus

Construct:

+1, +a

Related:

operators leaves unary + out of the language; no record plans it

op.unary-plus.mjs:

export default +"1";

What fjs compile prints:

op.unary-plus.mjs:1:16 - error: unexpected token
1 | export default +"1";
  |                ^

op.import-call

Construct:

import("m")

op.import-call.mjs:

export default import("./a.f.js");

What fjs compile prints:

op.import-call.mjs:1:16 - error: reserved word
1 | export default import("./a.f.js");
  |                ^

op.import-meta

Construct:

import.meta

op.import-meta.mjs:

export default import.meta.url;

What fjs compile prints:

op.import-meta.mjs:1:16 - error: reserved word
1 | export default import.meta.url;
  |                ^

op.tagged-template

Construct:

tag`x`

op.tagged-template.mjs:

const tag = s => s[0];
export default tag`x`;

What fjs compile prints:

op.tagged-template.mjs:2:19 - error: unexpected token
2 | export default tag`x`;
  |                   ^

acc.property-assignment

Construct:

a.b = 1

Related:

related: mutability

acc.property-assignment.mjs:

const f = o => { o.b = 1; return o; };
export default f({});

What fjs compile prints:

acc.property-assignment.mjs:1:22 - error: unexpected token
1 | const f = o => { o.b = 1; return o; };
  |                      ^

name.forward-reference

Construct:

export const a = b; export const b = 1;

Related:

forward references resolves only the object grouping and keeps refusing a later const

name.forward-reference.mjs:

const f = () => b;
const b = 1;
export default f();

What fjs compile prints:

name.forward-reference.mjs:1:17 - error: const not found
1 | const f = () => b;
  |                 ^

st.for

Construct:

for (const x of values) { }, for (const key in value) { }

No sample yet.

st.for-in-of

Construct:

for (k in o), for (x of a)

st.for-in-of.mjs:

const f = a => { let s = 0; for (const x of a) { s = s + x; } return s; };
export default f([1, 2]);

What fjs compile prints:

st.for-in-of.mjs:1:29 - error: for-of is not admitted
1 | const f = a => { let s = 0; for (const x of a) { s = s + x; } return s; };
  |                             ^

st.do-while

Construct:

do { } while (c)

st.do-while.mjs:

const f = () => { let i = 0; do { i = i + 1; } while (i < 3); return i; };
export default f();

What fjs compile prints:

st.do-while.mjs:1:30 - error: unexpected token
1 | const f = () => { let i = 0; do { i = i + 1; } while (i < 3); return i; };
  |                              ^

st.try

Construct:

try, catch, finally

st.try.mjs:

const f = () => { try { return 1; } catch { return 2; } };
export default f();

What fjs compile prints:

st.try.mjs:1:19 - error: unexpected token
1 | const f = () => { try { return 1; } catch { return 2; } };
  |                   ^

st.debugger

Construct:

debugger

st.debugger.mjs:

const f = () => { debugger; return 1; };
export default f();

What fjs compile prints:

st.debugger.mjs:1:19 - error: unexpected token
1 | const f = () => { debugger; return 1; };
  |                   ^

st.label

Construct:

x: while (c) { }

st.label.mjs:

const f = () => { let i = 0; x: while (i < 3) { i = i + 1; } return i; };
export default f();

What fjs compile prints:

st.label.mjs:1:31 - error: unexpected token
1 | const f = () => { let i = 0; x: while (i < 3) { i = i + 1; } return i; };
  |                               ^

st.directive

Construct:

"use strict";, a directive, which a module, strict already, makes nothing of

Related:

call statements leave it refused, as before; no record decides whether to admit it as the nothing it is

st.directive.mjs:

"use strict";
export default 1;

What fjs compile prints:

st.directive.mjs:1:1 - error: unexpected token
1 | "use strict";
  | ^

st.literal-call

Construct:

a call statement opening with a literal, "a".trim();, 1 .toFixed(2);

Related:

call statements begin with a name; a literal continues no statement before it, so no hazard refuses it, and no record admits it

st.literal-call.mjs:

const f = () => { "a".trim(); return 1; };
export default f();

What fjs compile prints:

st.literal-call.mjs:1:19 - error: unexpected token
1 | const f = () => { "a".trim(); return 1; };
  |                   ^

decl.function

Construct:

function f() {}, function () {}

decl.function.mjs:

function f() { return 1; }
export default f();

What fjs compile prints:

decl.function.mjs:1:1 - error: unexpected token
1 | function f() { return 1; }
  | ^

decl.generator

Construct:

function* g() {}

decl.generator.mjs:

function* g() { yield 1; }
export default g;

What fjs compile prints:

decl.generator.mjs:1:1 - error: unexpected token
1 | function* g() { yield 1; }
  | ^

decl.accessor

Construct:

{ get a() { return 1 } }, { set a(v) {} }

decl.accessor.mjs:

export default { get a() { return 1; } };

What fjs compile prints:

decl.accessor.mjs:1:22 - error: unexpected token
1 | export default { get a() { return 1; } };
  |                      ^

decl.method

Construct:

{ f() { return 1 } }

decl.method.mjs:

export default { f() { return 1; } };

What fjs compile prints:

decl.method.mjs:1:19 - error: unexpected token
1 | export default { f() { return 1; } };
  |                   ^

decl.pattern-object-rest

Construct:

{ a, ...r } in a pattern or a parameter

Related:

destructuring files it as a follow-up

decl.pattern-object-rest.mjs:

const { a, ...r } = { a: 1, b: 2 };
export default r;

What fjs compile prints:

decl.pattern-object-rest.mjs:1:12 - error: rest element not supported
1 | const { a, ...r } = { a: 1, b: 2 };
  |            ^

decl.pattern-computed-key

Construct:

{ [k]: a }, { [Number(i)]: a }, { [(3)]: a }

Related:

destructuring

decl.pattern-computed-key.mjs:

const k = "a";
const { [k]: a } = { a: 1 };
export default a;

What fjs compile prints:

decl.pattern-computed-key.mjs:2:10 - error: computed key in a binding pattern not supported
2 | const { [k]: a } = { a: 1 };
  |          ^

mod.export-list

Construct:

const a = 1; export { a };

Related:

investigated in export lists

mod.export-list.mjs:

const a = 1;
export { a };

What fjs compile prints:

mod.export-list.mjs:2:8 - error: unexpected token
2 | export { a };
  |        ^

mod.reexport

Construct:

export { a } from "m", export * from "m"

Related:

whether it belongs is a question in export lists

mod.reexport.mjs:

export * from "./a.f.js";

What fjs compile prints:

mod.reexport.mjs:1:8 - error: unexpected token
1 | export * from "./a.f.js";
  |        ^

mod.side-effect-import

Construct:

import "./d";

Related:

named imports leaves it unsupported; no record plans it

mod.side-effect-import.mjs:

import "./a.f.js";
export default 1;

What fjs compile prints:

mod.side-effect-import.mjs:1:8 - error: unexpected token
1 | import "./a.f.js";
  |        ^

mod.string-import-name

Construct:

import { "x" as y } from "./d";

Related:

named imports leaves it unsupported; no record plans it

mod.string-import-name.mjs:

import { "x" as y } from "./a.f.js";
export default y;

What fjs compile prints:

mod.string-import-name.mjs:1:10 - error: unexpected token
1 | import { "x" as y } from "./a.f.js";
  |          ^

mod.top-level-await

Construct:

await 1;

Related:

related: promise

mod.top-level-await.mjs:

export default await 1;

What fjs compile prints:

mod.top-level-await.mjs:1:22 - error: unexpected token
1 | export default await 1;
  |                      ^

lit.octal

Construct:

0o7

Related:

numbers leaves it out; the roadmap records no use case yet

lit.octal.mjs:

export default 0o7;

What fjs compile prints:

lit.octal.mjs:1:17 - error: unexpected token
1 | export default 0o7;
  |                 ^

lit.trailing-dot

Construct:

5.

lit.trailing-dot.mjs:

export default 5.;

What fjs compile prints:

lit.trailing-dot.mjs:1:18 - error: unexpected token
1 | export default 5.;
  |                  ^

lit.string-escape

Construct:

"\x41", "\v", "\0", "\u{41}", a raw TAB

Related:

string literals defers them until a measured need appears

lit.string-escape.mjs:

export default "\x41";

What fjs compile prints:

lit.string-escape.mjs:1:16-2:1 - error: unexpected token
1 | export default "\x41";
  |                ^

lit.string-continuation

Construct:

a \ before a line terminator in a string

Related:

string literals defers it until a measured need appears

lit.string-continuation.mjs:

export default "a\
b";

What fjs compile prints:

lit.string-continuation.mjs:1:16-3:1 - error: unexpected token
1 | export default "a\
  |                ^

lit.template-escape

Construct:

`\x41`, `\v`, a raw TAB in a template

Related:

template literals calls them deferred; no roadmap item admits them

lit.template-escape.mjs:

export default `\x41`;

What fjs compile prints:

lit.template-escape.mjs:1:16 - error: unexpected token
1 | export default `\x41`;
  |                ^

Emergent Testing

Idle. Press Run to start the suite.

  • ./proof.f.mjs