Questions tagged [es2022]

ECMAScript 2022 (ES2022) is the 13th version of the ECMAScript language. It adds new features including Array.at(), RegExp match indices, and error.cause. Only use this tag where the question specifically relates to new features or technical changes provided in ECMAScript 2022.

ECMAScript 2022 (ES2022) is the 13th version of the language.

A full list of finished proposals can be found here.

21 questions
1
vote
0 answers

VSCode extension throws regex indices error only when other extension is enabled

Background I am working on an extension (vscode-color-blocks) that uses RegExp match indices (new in ES2022). This means I am using a regex string with the d flag to get indices (relational positions) of each capture group in my regex…
Zoom
  • 400
  • 1
  • 5
  • 20
0
votes
0 answers

Unit test fails because of static method

I encountered an interesting problem, there is such a service import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class TestService { static generate(url: string, response: string): string[] { return [url…
Joe Kappa
  • 39
  • 3
0
votes
0 answers

Why when using ts-node am I getting an Uncaught SyntaxError: Unexpected token 'export'?

I'm trying to do something like the following, and these are the contents of ./env/config referenced below: import path from 'path'; export default await import(`./${process.env.NODE_ENV || 'development'}`).then((env) => { const defaults = { …
mkelley33
  • 5,323
  • 10
  • 47
  • 71
0
votes
0 answers

Getting modules to be 'recognized' externally in a browser page not using npm

I'm running this in the browser as an html page and not using npm etc :