diff --git a/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js b/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js index df6d1f56a0b..5901ca24ff7 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/modifiers/on-test.js @@ -2,6 +2,7 @@ import { EMBER_GLIMMER_ON_MODIFIER } from '@ember/canary-features'; import { moduleFor, RenderingTestCase, runTask } from 'internal-test-helpers'; import { isChrome, isFirefox } from '@ember/-internals/browser-environment'; import { privatize as P } from '@ember/-internals/container'; +import { HAS_NATIVE_PROXY } from '@ember/-internals/utils'; const isIE11 = !window.ActiveXObject && 'ActiveXObject' in window; @@ -320,12 +321,23 @@ if (EMBER_GLIMMER_ON_MODIFIER) { }, /You must pass a function as the second argument to the `on` modifier/); } - '@test asserts if the provided callback accesses `this` without being bound prior to passing to on'() { + '@test asserts if the provided callback accesses `this` without being bound prior to passing to on'( + assert + ) { this.render(``, { myFunc() { - expectAssertion(() => { - this.arg1; - }, /You accessed `this.arg1` from a function passed to the `on` modifier, but the function itself was not bound to a valid `this` context. Consider updating to usage of `@action`./); + if (HAS_NATIVE_PROXY) { + expectAssertion(() => { + this.arg1; + }, /You accessed `this.arg1` from a function passed to the `on` modifier, but the function itself was not bound to a valid `this` context. Consider updating to usage of `@action`./); + } else { + // IE11 + assert.strictEqual( + this, + null, + 'this is null on browsers without native proxy support' + ); + } }, arg1: 'foo', diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index bf2afc30479..acfb2c2daaf 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -24,8 +24,8 @@ export const DEFAULT_FEATURES = { EMBER_NATIVE_DECORATOR_SUPPORT: true, EMBER_GLIMMER_FN_HELPER: true, EMBER_CUSTOM_COMPONENT_ARG_PROXY: null, - EMBER_GLIMMER_ON_MODIFIER: null, - EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: null, + EMBER_GLIMMER_ON_MODIFIER: true, + EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: true, }; /**