From 299254f71a462d3ab70e81d394b3f695bf1d38ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 05:23:43 +0000 Subject: [PATCH 1/2] Initial plan From 8a7cfca3c02254535fa2e04d26060d15f3f7653a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 06:13:16 +0000 Subject: [PATCH 2/2] Fix assert conditions to use boolean values instead of functions, fix incorrect string replacements Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> --- packages/@ember/-internals/glimmer/lib/resolver.ts | 2 +- packages/@ember/-internals/runtime/lib/mixins/-proxy.ts | 2 +- packages/@ember/-internals/views/lib/views/states.ts | 4 ++-- packages/@ember/debug/index.ts | 2 +- .../@glimmer/runtime/lib/compiled/opcodes/component.ts | 2 +- .../@glimmer/runtime/lib/compiled/opcodes/expressions.ts | 2 +- packages/@glimmer/validator/test/tracking-test.ts | 8 ++++---- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/@ember/-internals/glimmer/lib/resolver.ts b/packages/@ember/-internals/glimmer/lib/resolver.ts index e59390631b2..b2cff0529a8 100644 --- a/packages/@ember/-internals/glimmer/lib/resolver.ts +++ b/packages/@ember/-internals/glimmer/lib/resolver.ts @@ -172,7 +172,7 @@ export default class ResolverImpl implements ClassicResolver { // bound in the factoryFor result, including type-based injections if (import.meta.env?.DEV) { - // In import.meta.env?.DEV we need to only set the associated value once, otherwise + // In DEV mode we need to only set the associated value once, otherwise // we'll trigger an assertion if (!CLASSIC_HELPER_MANAGER_ASSOCIATED.has(factory)) { CLASSIC_HELPER_MANAGER_ASSOCIATED.add(factory); diff --git a/packages/@ember/-internals/runtime/lib/mixins/-proxy.ts b/packages/@ember/-internals/runtime/lib/mixins/-proxy.ts index 73698983552..a4cbfae83d0 100644 --- a/packages/@ember/-internals/runtime/lib/mixins/-proxy.ts +++ b/packages/@ember/-internals/runtime/lib/mixins/-proxy.ts @@ -42,7 +42,7 @@ function customTagForProxy(proxy: object, key: string, addMandatorySetter?: bool if (key in proxy) { if (import.meta.env?.DEV && addMandatorySetter) { - assert('[BUG] setupMandatorySetter should be set when debugging', setupMandatorySetter); + assert('[BUG] setupMandatorySetter should be set when debugging', setupMandatorySetter !== undefined); setupMandatorySetter(tag, proxy, key); } diff --git a/packages/@ember/-internals/views/lib/views/states.ts b/packages/@ember/-internals/views/lib/views/states.ts index e36f3c04884..14f6f608b9d 100644 --- a/packages/@ember/-internals/views/lib/views/states.ts +++ b/packages/@ember/-internals/views/lib/views/states.ts @@ -68,8 +68,8 @@ const IN_DOM: Readonly = Object.freeze({ let elementId = view.elementId; assert( - '[BUG] Expected teardownMandatorySetter to be set in import.meta.env?.DEV mode', - teardownMandatorySetter + '[BUG] Expected teardownMandatorySetter to be set in DEV mode', + teardownMandatorySetter !== undefined ); teardownMandatorySetter(view, 'elementId'); diff --git a/packages/@ember/debug/index.ts b/packages/@ember/debug/index.ts index 50199f56b28..c9c0232c1cf 100644 --- a/packages/@ember/debug/index.ts +++ b/packages/@ember/debug/index.ts @@ -162,7 +162,7 @@ if (import.meta.env?.DEV) { @public */ setDebugFunction('debug', function debug(message) { - console.debug(`import.meta.env?.DEV: ${message}`); /* eslint-disable-line no-console */ + console.debug(`Ember: ${message}`); /* eslint-disable-line no-console */ }); /** diff --git a/packages/@glimmer/runtime/lib/compiled/opcodes/component.ts b/packages/@glimmer/runtime/lib/compiled/opcodes/component.ts index 8d14f84b8b6..b2477fa2bfe 100644 --- a/packages/@glimmer/runtime/lib/compiled/opcodes/component.ts +++ b/packages/@glimmer/runtime/lib/compiled/opcodes/component.ts @@ -790,7 +790,7 @@ APPEND_OPCODES.add(VM_MAIN_OP, (vm, { op1: register }) => { APPEND_OPCODES.add(VM_POPULATE_LAYOUT_OP, (vm, { op1: register }) => { let { stack } = vm; - // In import.meta.env.DEV handles could be ErrHandle objects + // In DEV mode handles could be ErrHandle objects let handle = check(stack.pop(), CheckHandle); let table = check(stack.pop(), CheckProgramSymbolTable); diff --git a/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts b/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts index 14f2d021b13..358df6b047f 100644 --- a/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts +++ b/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts @@ -79,7 +79,7 @@ APPEND_OPCODES.add(VM_CURRY_OP, (vm, { op1: type, op2: _isStrict }) => { let isStrict = false; if (import.meta.env?.DEV) { - // strict check only happens in import.meta.env.DEV builds, no reason to load it otherwise + // strict check only happens in DEV builds, no reason to load it otherwise isStrict = vm.constants.getValue(decodeHandle(_isStrict)); } diff --git a/packages/@glimmer/validator/test/tracking-test.ts b/packages/@glimmer/validator/test/tracking-test.ts index f2ff4bac76b..7a87eff9e9d 100644 --- a/packages/@glimmer/validator/test/tracking-test.ts +++ b/packages/@glimmer/validator/test/tracking-test.ts @@ -398,21 +398,21 @@ module('@glimmer/validator: tracking', () => { }); if (import.meta.env?.DEV) { - test('createCache throws an error in import.meta.env.DEV mode if users to use with a non-function', (assert) => { + test('createCache throws an error in DEV mode if users to use with a non-function', (assert) => { assert.throws( () => createCache(123 as any), /Error: createCache\(\) must be passed a function as its first parameter. Called with: 123/u ); }); - test('getValue throws an error in import.meta.env.DEV mode if users to use with a non-cache', (assert) => { + test('getValue throws an error in DEV mode if users to use with a non-cache', (assert) => { assert.throws( () => getValue(123 as any), /Error: getValue\(\) can only be used on an instance of a cache created with createCache\(\). Called with: 123/u ); }); - test('isConst throws an error in import.meta.env.DEV mode if users attempt to check a function before it has been called', (assert) => { + test('isConst throws an error in DEV mode if users attempt to check a function before it has been called', (assert) => { let cache = createCache(() => { // do nothing; }); @@ -423,7 +423,7 @@ module('@glimmer/validator: tracking', () => { ); }); - test('isConst throws an error in import.meta.env.DEV mode if users attempt to use with a non-cache', (assert) => { + test('isConst throws an error in DEV mode if users attempt to use with a non-cache', (assert) => { assert.throws( () => isConst(123 as any), /Error: isConst\(\) can only be used on an instance of a cache created with createCache\(\). Called with: 123/u