diff --git a/blueprints/component/index.js b/blueprints/component/index.js index a5d8fdc9fa8..e93a0089792 100644 --- a/blueprints/component/index.js +++ b/blueprints/component/index.js @@ -14,12 +14,10 @@ const OCTANE = process.env.EMBER_VERSION === 'octane'; // TODO: this should be reading from the @ember/canary-features module // need to refactor broccoli/features.js to be able to work more similarly // to https://github.com/emberjs/data/pull/6231 -const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = OCTANE; +const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = true; // intentionally avoiding use-edition-detector module.exports = { - EMBER_GLIMMER_SET_COMPONENT_TEMPLATE, - description: 'Generates a component.', availableOptions: [ diff --git a/packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js b/packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js index ead2666701c..e569df0789e 100644 --- a/packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js +++ b/packages/@ember/-internals/glimmer/tests/integration/components/component-template-test.js @@ -4,6 +4,7 @@ import { EMBER_GLIMMER_SET_COMPONENT_TEMPLATE, EMBER_MODULE_UNIFICATION, } from '@ember/canary-features'; +import { HAS_NATIVE_SYMBOL } from '@ember/-internals/utils'; import { Component, compile } from '../../utils/helpers'; import { setComponentTemplate, getComponentTemplate } from '../../..'; @@ -74,9 +75,11 @@ if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) { setComponentTemplate(compile('foo'), 'foo'); }, /Cannot call `setComponentTemplate` on `foo`/); - expectAssertion(() => { - setComponentTemplate(compile('foo'), Symbol('foo')); - }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/); + if (HAS_NATIVE_SYMBOL) { + expectAssertion(() => { + setComponentTemplate(compile('foo'), Symbol('foo')); + }, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/); + } } '@test calling it twice on the same object asserts'() { diff --git a/packages/@ember/-internals/utils/lib/symbol-utils.ts b/packages/@ember/-internals/utils/lib/symbol-utils.ts index 2ef59bca6a5..324aaa1ed15 100644 --- a/packages/@ember/-internals/utils/lib/symbol-utils.ts +++ b/packages/@ember/-internals/utils/lib/symbol-utils.ts @@ -3,7 +3,5 @@ export const HAS_NATIVE_SYMBOL = (function() { return false; } - // use `Object`'s `.toString` directly to prevent us from detecting - // polyfills as native - return Object.prototype.toString.call(Symbol()) === '[object Symbol]'; + return typeof Symbol() === 'symbol'; })(); diff --git a/packages/@ember/canary-features/index.ts b/packages/@ember/canary-features/index.ts index 9099973e3d8..4df22887a0d 100644 --- a/packages/@ember/canary-features/index.ts +++ b/packages/@ember/canary-features/index.ts @@ -23,7 +23,7 @@ export const DEFAULT_FEATURES = { EMBER_GLIMMER_FN_HELPER: true, EMBER_CUSTOM_COMPONENT_ARG_PROXY: true, EMBER_FRAMEWORK_OBJECT_OWNER_ARGUMENT: true, - EMBER_GLIMMER_SET_COMPONENT_TEMPLATE: null, + EMBER_GLIMMER_SET_COMPONENT_TEMPLATE: true, }; /**