Skip to content

Invalid explicit resource management tests in staging #4498

Open
@nicolo-ribaudo

Description

@nicolo-ribaudo

From Babel's test results:

not ok 44949 test/staging/explicit-resource-management/await-using-in-switch-case-block.js default # (expected success, got parser error)
  ---
  name: SyntaxError
  message: >-
    unknown: Using declaration cannot appear in the top level when source type is
    `script` or in the bare case statement. (358:6)

      356 |   switch (label) {
      357 |     case 1:
    > 358 |       await using x = {
          |       ^
      359 |         value: 1,
      360 |         [Symbol.asyncDispose]() {
      361 |           caseBlockValues.push(42);
  ...
not ok 44951 test/staging/explicit-resource-management/await-using-in-switch-case-block.js strict mode # (expected success, got parser error)
  ---
  name: SyntaxError
  message: >-
    unknown: Using declaration cannot appear in the top level when source type is
    `script` or in the bare case statement. (359:6)

      357 |   switch (label) {
      358 |     case 1:
    > 359 |       await using x = {
          |       ^
      360 |         value: 1,
      361 |         [Symbol.asyncDispose]() {
      362 |           caseBlockValues.push(42);
  ...
not ok 44975 test/staging/explicit-resource-management/call-dispose-methods.js default # (expected success, got parser error)
  ---
  name: SyntaxError
  message: >-
    unknown: Using declaration cannot appear in the top level when source type is
    `script` or in the bare case statement. (244:6)

      242 |   switch (label) {
      243 |     case 1:
    > 244 |       using x = {
          |       ^
      245 |         value: 1,
      246 |         [Symbol.dispose]() {
      247 |           caseBlockValues.push(42);
  ...
not ok 44976 test/staging/explicit-resource-management/call-dispose-methods.js strict mode # (expected success, got parser error)
  ---
  name: SyntaxError
  message: >-
    unknown: Using declaration cannot appear in the top level when source type is
    `script` or in the bare case statement. (245:6)

      243 |   switch (label) {
      244 |     case 1:
    > 245 |       using x = {
          |       ^
      246 |         value: 1,
      247 |         [Symbol.dispose]() {
      248 |           caseBlockValues.push(42);
  ...

These test cases are invalid since last plenary, and they should be removed eventually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions