js/src/tests/test262/language/statements/for-of/head-using-init.js
author Emilio Cobos Álvarez <emilio@crisal.io>
Thu, 10 Jul 2025 09:08:54 +0000 (2 hours ago)
changeset 795952 1d422913e1cb1658224a2d269f8e4c9e80032d29
parent 788559 81974a48653c73ad24e330bb763a7bd96e059e91
permissions -rw-r--r--
Bug 1976623 - Create drag popups eagerly for now. r=tnikkel,layout-reviewers Trivially restores pre-regression behavior, for now. Differential Revision: https://phabricator.services.mozilla.com/D256769
// |reftest| shell-option(--enable-explicit-resource-management) skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('explicit-resource-management'))||!xulRuntime.shell) error:SyntaxError -- explicit-resource-management is not enabled unconditionally, requires shell-options
// Copyright (C) 2023 Ron Buckton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-for-in-and-for-of-statements
description: >
  ForDeclaration containing 'using' does not support an initializer
info: |
  IterationStatement:
    for (ForDeclaration of AssignmentExpression) Statement
negative:
  phase: parse
  type: SyntaxError
features: [explicit-resource-management]
---*/

$DONOTEVALUATE();

const obj = { [Symbol.dispose]() { } };
for (using x = obj of []) {}