Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@ember/-internals/glimmer/lib/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class ResolverImpl implements ClassicResolver<InternalOwner> {
// 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);
Expand Down
2 changes: 1 addition & 1 deletion packages/@ember/-internals/runtime/lib/mixins/-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/-internals/views/lib/views/states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ const IN_DOM: Readonly<ViewState> = 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');

Expand Down
2 changes: 1 addition & 1 deletion packages/@ember/debug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>(decodeHandle(_isStrict));
}

Expand Down
8 changes: 4 additions & 4 deletions packages/@glimmer/validator/test/tracking-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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
Expand Down
Loading