{"id":13433218,"url":"https://github.com/hemanth/es-next","last_synced_at":"2025-04-04T12:10:40.778Z","repository":{"id":28394386,"uuid":"31908652","full_name":"hemanth/es-next","owner":"hemanth","description":"stage-0 to stage-4 ECMAscript proposals.","archived":false,"fork":false,"pushed_at":"2017-10-25T16:09:40.000Z","size":54,"stargazers_count":676,"open_issues_count":4,"forks_count":45,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-03-27T20:25:07.571Z","etag":null,"topics":["esnext"],"latest_commit_sha":null,"homepage":"https://git.io/es-next","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hemanth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-09T16:08:48.000Z","updated_at":"2024-12-08T09:20:22.000Z","dependencies_parsed_at":"2022-09-03T14:41:40.596Z","dependency_job_id":null,"html_url":"https://github.com/hemanth/es-next","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fes-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fes-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fes-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemanth%2Fes-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemanth","download_url":"https://codeload.github.com/hemanth/es-next/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174456,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esnext"],"created_at":"2024-07-31T02:01:22.629Z","updated_at":"2025-04-04T12:10:40.759Z","avatar_url":"https://github.com/hemanth.png","language":null,"funding_links":[],"categories":["Others","miscellaneous","Js"],"sub_categories":[],"readme":"\u003e stage-0 to stage-4 ECMAscript proposals.\n\n__TOC:__\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Stage 0:](#stage-0)\n  - [Defensible Classes](#defensible-classes)\n  - [Relationships](#relationships)\n  - [String.prototype.at](#stringprototypeat)\n  - [Reflect.isCallable](#reflectiscallable)\n  - [Reflect.isConstructor](#reflectisconstructor)\n  - [Additional metaproperties](#additional-metaproperties)\n  - [Function Bind Syntax](#function-bind-syntax)\n  - [64-Bit Integer Operations](#64-bit-integer-operations)\n  - [Method Parameter Decorators](#method-parameter-decorators)\n  - [Function Expression Decorators](#function-expression-decorators)\n  - [Zones](#zones)\n  - [Object enumerables](#object-enumerables)\n  - [Nested import declarations](#nested-import-declarations)\n  - [is{Type} APIs](#istype-apis)\n  - [Orthogonal Class Member Syntax](#orthogonal-class-member-syntax)\n  - [Pattern Matching Syntax](#pattern-matching-syntax)\n  - [Structured cloning and transfer](#structured-cloning-and-transfer)\n  - [WHATWG URL](#whatwg-url)\n- [Stage 1:](#stage-1)\n  - [export v from \"mod\"; statements](#export-v-from-mod-statements)\n  - [Observable](#observable)\n  - [String.prototype.matchAll](#stringprototypematchall)\n  - [WeakRefs](#weakrefs)\n  - [Frozen Realms](#frozen-realms)\n  - [Math Extensions](#math-extensions)\n  - [`of` and `from` on collection constructors](#of-and-from-on-collection-constructors)\n  - [Generator arrow functions.](#generator-arrow-functions)\n  - [Date.parse fallback semantics](#dateparse-fallback-semantics)\n  - [Generator arrow functions (=\u003e*)](#generator-arrow-functions-)\n  - [Promise.try](#promisetry)\n  - [`of` and `from` on collection](#of-and-from-on-collection)\n  - [Optional Chaining](#optional-chaining)\n  - [Math.signbit: IEEE-754 sign bit](#mathsignbit-ieee-754-sign-bit)\n  - [Error Stacks](#error-stacks)\n  - [do expressions](#do-expressions)\n  - [Realms](#realms)\n- [Stage 2:](#stage-2)\n  - [Template Literal Revision](#template-literal-revision)\n  - [function.sent Meta Property](#functionsent-meta-property)\n  - [Class Property Declarations](#class-property-declarations)\n  - [Class and Property Decorators](#class-and-property-decorators)\n  - [String.prototype.{trimStart,trimEnd}](#stringprototypetrimstarttrimend)\n  - [Legacy RegExp features](#legacy-regexp-features)\n  - [Intl.Segmenter: Unicode segmentation](#intlsegmenter-unicode-segmentation)\n  - [export * as ns from \"mod\"; statements](#export--as-ns-from-mod-statements)\n- [Stage 3:](#stage-3)\n  - [global](#global)\n  - [Rest and Spread properties](#rest-and-spread-properties)\n  - [Async-iteration](#async-iteration)\n  - [Function.prototype.toString revision](#functionprototypetostring-revision)\n  - [SIMD APIs](#simd-apis)\n  - [Lifting Template Literal Restriction](#lifting-template-literal-restriction)\n  - [Shared memory and atomics](#shared-memory-and-atomics)\n  - [global](#global-1)\n  - [import()](#import)\n  - [RegExp Lookbehind Assertions](#regexp-lookbehind-assertions)\n  - [Unicode property escapes in RE](#unicode-property-escapes-in-re)\n  - [RegExp Named Capture Groups](#regexp-named-capture-groups)\n  - [s (dotAll) flag for regular expressions](#s-dotall-flag-for-regular-expressions)\n  - [Asynchronous Iterators](#asynchronous-iterators)\n  - [Promise.prototype.finally](#promiseprototypefinally)\n  - [Class Fields](#class-fields)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n# Stage 0:\n\n## Defensible Classes \n\u003e Stage-0\n\n```js\n// const class\n\nconst class Point { \n  constructor(x, y) {\n    public getX() { return x; }\n    public getY() { return y; }\n  }\n  toString() { \n    return `\u003c${this.getX()}, ${this.getY()}\u003e`;\n  }\n}\n```\n\n## Relationships\n\u003e Stage-0\n\n```js\nx @ r // The object x is in the r relationship with what value?\nx @ r = y; // Store that x is in the r relationship with value y.\n```\n\n## String.prototype.at\n\u003e Stage-0\n\n```js\n'abc𝌆def'.at(3)\n// → '𝌆'\n```\n\n## Reflect.isCallable\n\u003e Stage-0\n\n```js\nReflect.isCallable(argument);\n```\n\n## Reflect.isConstructor\n\u003e Stage-0\n\n```js\nReflect.isConstructor(argument)\n```\n\n## Additional metaproperties\n\u003e Stage-0\n\n```js\nfunction.callee; // function object that is currently being evaluated by the running execution context.\n```\n\n```js\nfunction.count; // number of arguments pass to the function. \n```\n\n```js\nfunction.arguments; // array containing the actual arguments passed to the function.\n```\n\n## Function Bind Syntax\n\u003e Stage-0\n\n```js\n// :: which performs this binding and method extraction.\n\nPromise.resolve(123).then(::console.log);\n\n```\n## 64-Bit Integer Operations\n\u003e Stage-0\n\n```js\n// return the high 32 bit part of the 64 bit addition of (hi0, lo0) and (hi1, lo1)\nMath.iaddh(lo0, hi0, lo1, hi1);\n\n// return the high 32 bit part of the 64 bit subtraction of (hi0, lo0) and (hi1, lo1)\nMath.isubh(lo0, hi0, lo1, hi1);\n\n// return the high 32 bit part of the signed 64 bit product of the 32 bit numbers a and b\nMath.imulh(a, b);\n\n// return the high 32 bit part of the unsigned 64 bit product of the 32 bit numbers a and b\nMath.umulh(a, b);\n\n```\n\n## Method Parameter Decorators\n\u003e Stage-0\n\n//decorators that operate on method and constructor parameters.\n\n```js\nclass MyComponent {\n  refresh(@lastRefreshTime timeStamp) { … }\n}\n\nexport function lastRefreshTime(...) {\n  // at minimum, the arguments of this function should contain:\n  // - reference to owner of the parameter (the method)\n  // - parameter index\n  // - parameter name\n  // - is parameter a rest parameter?\n\n  // store parameter metadata using the same storage mechanism\n  // as the one used for methods\n}\n```\n\n## Function Expression Decorators\n\u003e Stage-0\n\n```js\nscheduleForFrequentReexecution(@memoize function(value) { \n  value++\n});\n\nexport function memoize(...) {\n  // at minimum, the arguments of this function should contain:\n  // - reference to the decorated function expression\n  // - arguments passed into the memoize function (if any)\n\n  // wrap the decorated function expression memoization implementation and return it\n}\n\n```\n\n## Zones\n\u003e Stage-0\n\n```js\n//a primitive for context propagation across multiple logically-connected async operations\n\nclass Zone {\n  constructor({ name, parent });\n\n  name;\n  get parent();\n\n  fork({ name });\n  run(callback);\n  wrap(callback);\n\n  static get current();\n}\n\nconst loadZone = Zone.current.fork({ name: \"loading zone\" });\nwindow.onload = loadZone.wrap(e =\u003e { ... });\n\n```\n## Object enumerables\n\u003e Stage-0\n\n```js\nObject.enumerableKeys(obj); // Ordered list of keys.\n```\n\n```js\nObject.enumerableValues(obj); // Ordered list of Values.\n```\n\n```js\nObject.enumerableEntries(obj); //Ordered list of key value pairs.\n```\n\n## Nested import declarations\n\u003e Stage-0\n\n```js\ndescribe(\"fancy feature #5\", () =\u003e {\n  import { strictEqual } from \"assert\";\n\n  it(\"should work on the client\", () =\u003e {\n    import { check } from \"./client.js\";\n    strictEqual(check(), \"client ok\");\n  });\n\n  it(\"should work on the client\", () =\u003e {\n    import { check } from \"./server.js\";\n    strictEqual(check(), \"server ok\");\n  });\n\n  it(\"should work on both client and server\", () =\u003e {\n    import { check } from \"./both.js\";\n    strictEqual(check(), \"both ok\");\n  });\n});\n```\n\n## is{Type} APIs\n\u003e Stage-0\n\n```js\nBuiltin.is(Date, vm.runInNewContext('Date'));     // false\n\n\nBuiltin.typeOf([]);                             // 'Array'\nBuiltin.typeOf(new ArrayBuffer());              // 'ArrayBuffer'\nBuiltin.typeOf(async function foo() {}); \n// So on.\n\n```\n\n## Orthogonal Class Member Syntax\n\u003e Stage-0\n\n```js\n//A kitchen sink example\nclass Foo {\n  //instance members\n  own x=0, y=0;  // two data properties\n  own #secret;   // a private field\n                 // initial value undefined\n  own *[Symbol.iterator](){yield this.#secret}\n                 // a generator method\n  own #callback(){}  //a private instance method  \n  //class constructor members               \n  static #p=new Set(), q=Foo.#p;\n                // a private field and a property\n                // of the class constructor                     \n  static get p(){return Foo.#p} //accessor method     \n  //prototype methods                \n  setCallback(f){this.#callback=f}\n  constructor(s){\n     this.#secret = s;\n  }\n}\n```\n\n## Pattern Matching Syntax\n\u003e Stage-0\n\n```js\nlet getLength = vector =\u003e match (vector) {\n    { x, y, z }: Math.sqrt(x ** 2 + y ** 2 + z ** 2),\n    { x, y }:    Math.sqrt(x ** 2 + y ** 2),\n    [...]:       vector.length,\n    else: {\n        throw new Error(\"Unknown vector type\");\n    }\n}\n```\n\n## Structured cloning and transfer\n\u003e Stage-0\n\n```js\nStructuredClone(input, transferList, targetRealm)\n```\n\n## WHATWG URL\n\u003e Stage-0\n\n```js\nconst base = new URL('http://example.org/foo');\nconst url = new URL('bar', base);\n```\n\n# Stage 1:\n\n## export v from \"mod\"; statements\n\u003e Stage-1\n\n```js\nexport v, {x, y as w} from \"mod\";\n\nexport v, * as ns from \"mod\";\n```\n\n## Observable\n\u003e Stage-1\n\n```js\n// Observable as a Constructor:\nfunction listen(element, eventName) {\n    return new Observable(observer =\u003e {\n        // Create an event handler which sends data to the sink\n        let handler = event =\u003e observer.next(event);\n\n        // Attach the event handler\n        element.addEventListener(eventName, handler, true);\n\n        // Return a function which will cancel the event stream\n        return () =\u003e {\n            // Detach the event handler from the element\n            element.removeEventListener(eventName, handler, true);\n        };\n    });\n}\n\n// Observable.of creates an Observable of the values provided as arguments\nObservable.of(\"R\", \"G\", \"B\").subscribe({\n    next(color) {\n        console.log(color);\n    }\n});\n\n// Observable.from converts its argument to an Observable.\nObservable.from([\"R\", \"G\", \"B\"]).subscribe({\n    next(color) {\n        console.log(color);\n    }\n});\n```\n\n## String.prototype.matchAll\n\u003e Stage-1\n\n```js\nvar str = 'Hello world!!!';\nvar regexp = /(\\w+)\\W*/g;\nconsole.log(str.matchAll(regexp));\n\n/*\n[\n  {\n    0: \"Hello \",\n    1: \"Hello\"\n    index: 0,\n    input: \"Hello world!!!\"\n  },\n  {\n    0: \"world!!!\",\n    1: \"world\"\n    index: 6,\n    input: \"Hello world!!!\"\n  }\n]\n*/\n\n```\n\n## WeakRefs\n\u003e Stage-1 \n\n```js\n// Make a new weak reference.\n// The target is a strong pointer to the object that will be pointed\n// at weakly by the result.\n// The executor is an optional argument that will be invoked after the\n// target becomes unreachable.\n// The holdings is an optional argument that will be provided to the\n// executor when it is invoked for target.\nmakeWeakRef(target, executor, holdings);\n```\n\n## Frozen Realms\n\u003e Stage-1\n\n```js\nclass Realm {\n  // From the prior Realm API proposal\n  const global -\u003e object                // access this realm's global object\n  eval(stringable) -\u003e any               // do an indirect eval in this realm\n\n  // We expect the rest of earlier proposal to be re-proposed eventually in\n  // some form, but do not rely here on any of the remainder.\n\n  // New with this proposal\n  static immutableRoot() -\u003e Realm       // transitively immutable realm\n  spawn(endowments) -\u003e Realm            // lightweight child realm\n}\n```\n## Math Extensions\n\u003e Stage-1\n\n```js\n// Possible ones:\nMath.map\nMath.scale\nMath.remap\nMath.clamp\nMath.constrain\nMath.toDegrees(double angrad)\nMath.toRadians(double angdeg)\n```\n\n## `of` and `from` on collection constructors\n\u003e Stage-1\n\n```js\nMap.of( ...items );\nMap.from( ...items );\n\nSet.of( ...items );\nSet.from( ...items );\n\nWeakMap.of( ...items );\nWeakMap.from( ...items );\n\nWeakSet.of( ...items );\nWeakSet.from( ...items );\n```\n\n## Generator arrow functions.\n\u003e Stage-1\n\n```js\nlet cat = *() =\u003e { yield 'meow'; }\n```\n\n## Date.parse fallback semantics\n\u003e Stage-1\n\n```js\n//  New grammar should be used as the \"fallback\" \n//  when date strings do not conform to the \n//  regular Date Time String Format.\n```\n\n## Generator arrow functions (=\u003e*)\t\n\u003e Stage-1\n\n```js\n// current\nx =\u003e x * x;\n(...) =\u003e { statements }\n(...) =\u003e ( expr )\n\n// proposed generator arrows...\n\n// Irregular\n() =*\u003e\n\n// Hostile to ! (async function)\n() =\u003e * { ...yield... }\n\n// Not good\n() =\u003e * (yield a, yield b)\n\n// Ok if 1 token\nx *=\u003e x * x;\n\n// Bad (ASI)\n*() =\u003e ...\n\n// Hostile to !\n(x) =* {...}\n```\n\n## Promise.try\n\u003e Stage-1\n\n```js\n// Promise.try(function() fn) -\u003e Promise\n```\n\n## `of` and `from` on collection \n\u003e Stage-1\n\n```js\nCollectionCreate ( C, source [ , mapfn [ , thisArg ] ] )\n\nMap.of ( ...items )\nSet.of ( ...items )\nWeakMap.of ( ...items )\nWeakSet.of ( ...items )\n\nMap.from ( source [ , mapFn [ , thisArg ] ] )\nSet.from ( source [ , mapFn [ , thisArg ] ] )\nWeakMap.from ( source [ , mapFn [ , thisArg ] ] )\nWeakSet.from ( source [ , mapFn [ , thisArg ] ] )\n```\n## Optional Chaining\n\u003e Stage-1\n\n```js\nobj?.prop         // optional property access\nobj?.[expr]       // ditto\nfunc?.(...args)   // optional function or method call\nnew C?.(...args)  // optional constructor invocation\n```\n\n## Math.signbit: IEEE-754 sign bit\n\u003e Stage-1\n\n```js\nMath.signbit(x);\n\n/*\nReturns whether the sign bit of x is set.\n\nIf n is NaN, the result is false.\nIf n is -0, the result is true.\nIf n is negative, the result is true.\nOtherwise, the result is false.\n*/\n```\n\n## Error Stacks\n\u003e Stage-1\n\n```js\nError.prototype.stack;\nSystem.getStack;\nSystem.getStackString;\n\n\nObject.getOwnPropertyDescriptor(new Error(), 'stack');\nObject.getOwnPropertyDescriptor(Error.prototype, 'stack');\n```\n\n## do expressions\n\u003e Stage-1\n\n```js\nlet x = do {\n  let tmp = f();\n  tmp * tmp + 1\n};\n\nlet x = do {\n  if (foo()) { f() }\n  else if (bar()) { g() }\n  else { h() }\n};\n```\n\n## Realms\n\u003e Stage-1\n\n```js\nlet realm = new Realm();\n\nlet outerGlobal = window;\nlet innerGlobal = realm.global;\n\nlet f = realm.evalScript(\"(function() { return 17 })\");\n\nf() === 17 // true\n\nReflect.getPrototypeOf(f) === outerGlobal.Function.prototype // false\nReflect.getPrototypeOf(f) === innerGlobal.Function.prototype // true\n\n\nclass EmptyRealm extends Realm {\n  constructor(...args) { super(...args); }\n  init() { /* do nothing */ }\n}\n\n\nclass FakeWindow extends Realm {\n  init() {\n    super.init(); // install the standard primordials\n    let global = this.global;\n\n    global.document = new FakeDocument(...);\n    global.alert = new Proxy(fakeAlert, { ... });\n    ...\n  }\n}\n```\n\n# Stage 2:\n\n## Template Literal Revision\n\u003e Stage-2 \n\n```js\n// The proposal is about fixing those Illegal token errors, avoid restrictions on escape sequences. \nlet document = latex`\n\\newcommand{\\fun}{\\textbf{Fun!}}  // works just fine\n\\newcommand{\\unicode}{\\textbf{Unicode!}} // Illegal token!\n\\newcommand{\\xerxes}{\\textbf{King!}} // Illegal token!\n\nBreve over the h goes \\u{h}ere // Illegal token!\n```\n\n## function.sent Meta Property\n\u003e Stage-2\n\n```js\n// Avoid ingnoring the first `next` call.\nfunction *adder(total=0) {\n   let increment=1;\n   do {\n       switch (request = function.sent){\n          case undefined: break;\n          case \"done\": return total;\n          default: increment = Number(request);\n       }\n       yield total += increment;\n   } while (true)\n}\n\nlet tally = adder();\ntally.next(0.1); // argument no longer ignored\ntally.next(0.1);\ntally.next(0.1);\nlet last=tally.next(\"done\");\nconsole.log(last.value);  //0.3\n```\n\n## Class Property Declarations\n\u003e Stage-2\n\n```js\n\n// Class instance field\nclass MyClass {\n  myProp = 42;\n\n  constructor() {\n    console.log(this.myProp); // Prints '42'\n  }\n}\n\n\n// Static property\nclass MyClass {\n  static myStaticProp = 42;\n\n  constructor() {\n    console.log(MyClass.myStaticProp); // Prints '42'\n  }\n}\n```\n\n```js\n// Class Static Properties\n\nclass MyClass {\n  static myStaticProp = 42;\n\n  constructor() {\n    console.log(MyClass.myStaticProp); // Prints '42'\n  }\n}\n```\n\n## Class and Property Decorators\n\u003e Stage-2\n\n```js\nclass C {\n  @writable(false)\n  method() { }\n}\n\nfunction writable(value) {\n  return function (target, key, descriptor) {\n     descriptor.writable = value;\n     return descriptor;\n  }\n}\n```\n\n## String.prototype.{trimStart,trimEnd}\n\u003e Stage-2\n\n```js\n\"    Hey JS!\".trimStart(); // \"Hey JS!\"\n\n\"    Hey JS!    \".trimEnd();// \"    Hey JS!\"\n\n// P.S: trimLeft/trimRight are aliases.\n```\n\n## Legacy RegExp features\n\u003e Stage-2\n\n```js\nRegExpAlloc( newTarget );\n\nRegExpBuiltInExec( R, S );\n\nRegExp.input;\n\nRegExp.prototype.compile( pattern, flags ); // modifications\n```\n\n## Intl.Segmenter: Unicode segmentation\n\u003e Stage-2\n\n```js\n// Create a segmenter in your locale\nlet segmenter = Intl.Segmenter(\"fr\", {type: \"word\"});\n\n// Get an iterator over a string\nlet iterator = segmenter.segment(\"Ceci n'est pas une pipe\");\n\n// Iterate over it!\nfor (let {segment, breakType} of iterator) {\n  console.log(`segment: ${segment} breakType: ${breakType}`);\n  break;\n}\n\n// logs the following to the console:\n// index: Ceci breakType: letter\n```\n\n## export * as ns from \"mod\"; statements\n\u003e Stage-2\n\n```js\nexport * as ns from \"mod\";  // Exporting the ModuleNameSpace object as a named export.\n```\n\n# Stage 3:\n\n## global\n\u003e Stage-3\n\n```js\n// global to rule them all.\n\nvar getGlobal = function () {\n    // the only reliable means to get the global object is\n    // `Function('return this')()`\n    // However, this causes CSP violations in Chrome apps.\n    if (typeof self !== 'undefined') { return self; }\n    if (typeof window !== 'undefined') { return window; }\n    if (typeof global !== 'undefined') { return global; }\n    throw new Error('unable to locate global object');\n};\n\n```\n\n## Rest and Spread properties\n\u003e Stage-3\n\n```js\nlet { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; // Rest.\n\n\nlet n = { x, y, ...z }; // Spread.\n\n```\n\n## Async-iteration\n\u003e Stage-3\n\n```js\nasyncIterator\n  .next()\n  .then(({ value, done }) =\u003e /* ... */);\n```\n\n## Function.prototype.toString revision\n\u003e Stage-3\n\n```js\n// String's parse must contains the same\n// function body and parameter list as the original.\n\nO.gOPD({ get a(){} }, \"a\").get // \"function a(){}\"\n\nO.gOPD({ set a(b){} }, \"a\").set // \"function a(b){}\"\n\n```\n\n## SIMD APIs\n\u003e Stage-3\n\n```js\n/*a meta-variable ranging over all SIMD types:\n  Float32x4, Int32x4, Int16x8 Int8x16, Uint32x4, \n  Uint16x8, Uint8x16, Bool32x4, Bool16x8 and Bool8x16. */\n```\n\n## Lifting Template Literal Restriction\n\u003e Stage-3\n\n```js\nfunction tag(strs) {\n  strs[0] === undefined\n  strs.raw[0] === \"\\\\unicode and \\\\u{55}\";\n}\ntag`\\unicode and \\u{55}`\n\nlet bad = `bad escape sequence: \\unicode`; // throws early error\n```\n\n## Shared memory and atomics\n\u003e Stage-3\n\n```js\nvar sab = new SharedArrayBuffer(1024);  // 1KiB shared memory\n\nw.postMessage(sab, [sab])\n\n// In the worker:\n\nvar sab;\nonmessage = function (ev) {\n   sab = ev.data;  // 1KiB shared memory, the same memory as in the parent\n}\n```\n\n## global\n\u003e stage 3\n\n```js\ntypeof global; // object, helps in writing a portable code.\n```\n\n## import()\n\u003e stage 3\n\n```js\nimport(`./language-packs/${navigator.language}.js`) // import(specifier)\n```\n\n## RegExp Lookbehind Assertions\n\u003e Stage-3\n\n```js\nconst str = '1947';\n\n// (?\u003c=(\\d+)(\\d+))$/ =\u003e (947) and (1)\n// Greediness proceeds from right to left\n\n\n// match[1] =\u003e 947 and match[2] =\u003e 1\n// Numbering capture groups\n\n// /(?\u003c=\\1(.))/\n// Referring to capture groups\n\n// /(?\u003c!.)/\n// Negative assertions\n```\n\n## Unicode property escapes in RE\n\u003e Stage-3\n\n```js\nconst regexGreekSymbol = /\\p{Script=Greek}/u;\nregexGreekSymbol.test('π');\n```\n\n## RegExp Named Capture Groups\n\u003e Stage-3\n\n```js\nlet {one, two} = /^(?\u003cone\u003e.*):(?\u003ctwo\u003e.*)$/u.exec('foo:bar');\nconsole.log(`one: ${one}, two: ${two}`);  // prints one: foo, two: bar\n```\n\n## s (dotAll) flag for regular expressions\n\u003e Stage-3\n\n```js\nconst re = /foo.bar/s; // Or, `const re = new RegExp('foo.bar', 's');`.\nre.test('foo\\nbar');\n// → true\nre.dotAll\n// → true\nre.flags\n// → 's'\n\n/foo.bar/s.test('foo\\nbar');\n// → true\n```\n\n## Asynchronous Iterators\n\u003e Stage-3\n\n```js\nasyncIterator.next().then(result =\u003e console.log(result.value));\n\n\nfor await (let line of readLines(filePath)) {\n    print(line);\n}\n\nasync function *readLines(path) {\n\n    let file = await fileOpen(path);\n\n    try {\n\n        while (!file.EOF)\n            yield file.readLine();\n\n    } finally {\n\n        await file.close();\n    }\n}\n```\n\n## Promise.prototype.finally\n\u003e Stage-3\n\n```js\nsomePromise()\n.then(() =\u003e {})\n.catch(() =\u003e {})\n.finally(() =\u003e {})\n```\n\n## Class Fields\n\u003e Stage-3\n\n```js\nclass Point {\n    #x = 0;  // private fields start with #\n    myProp = 42; // public field\n\n    constructor() {\n        this.#x; // 0\n        this.myProp; // 0\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemanth%2Fes-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemanth%2Fes-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemanth%2Fes-next/lists"}