From 1e50958456de7bff99e09c8202efcc256d4be498 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 13 May 2019 11:04:15 -0400 Subject: [PATCH 1/3] [FEATURE] Enable `on` modifier by default. --- packages/@ember/canary-features/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index bf2afc30479..2feec039672 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -24,7 +24,7 @@ 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_GLIMMER_ON_MODIFIER: true, EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: null, }; From d1977547c09940c84daf83610b646445656bae92 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 13 May 2019 11:05:31 -0400 Subject: [PATCH 2/3] [FEATURE] Enable Inject Parameter Normalization by default. --- packages/@ember/canary-features/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index 2feec039672..acfb2c2daaf 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -25,7 +25,7 @@ export const DEFAULT_FEATURES = { EMBER_GLIMMER_FN_HELPER: true, EMBER_CUSTOM_COMPONENT_ARG_PROXY: null, EMBER_GLIMMER_ON_MODIFIER: true, - EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: null, + EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: true, }; /** From 7a64ac6af4c92972f66d0447c5239fee5871ed17 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 13 May 2019 13:26:11 -0400 Subject: [PATCH 3/3] Ensure native proxy assertion for on does not run in IE11. --- .../tests/integration/modifiers/on-test.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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',