ember-source 7.1.0-alpha.3 → 7.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/container/index.js +4 -401
- package/dist/dev/packages/@ember/-internals/deprecations/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/environment/index.js +3 -151
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +14 -15
- package/dist/dev/packages/@ember/-internals/meta/lib/meta.js +0 -1
- package/dist/dev/packages/@ember/-internals/metal/index.js +18 -9
- package/dist/dev/packages/@ember/-internals/routing/index.js +1 -10
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -12
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -10
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -10
- package/dist/dev/packages/@ember/-internals/string/index.js +0 -1
- package/dist/dev/packages/@ember/-internals/utils/index.js +8 -3
- package/dist/dev/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -1
- package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -12
- package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -11
- package/dist/dev/packages/@ember/-internals/views/lib/system/utils.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -18
- package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +5 -28
- package/dist/dev/packages/@ember/application/instance.js +3 -22
- package/dist/dev/packages/@ember/application/namespace.js +4 -11
- package/dist/dev/packages/@ember/array/index.js +7 -15
- package/dist/dev/packages/@ember/array/proxy.js +10 -14
- package/dist/dev/packages/@ember/canary-features/index.js +1 -1
- package/dist/dev/packages/@ember/component/helper.js +1 -14
- package/dist/dev/packages/@ember/component/index.js +1355 -16
- package/dist/dev/packages/@ember/component/template-only.js +1 -9
- package/dist/dev/packages/@ember/controller/index.js +3 -19
- package/dist/dev/packages/@ember/debug/container-debug-adapter.js +0 -19
- package/dist/dev/packages/@ember/debug/data-adapter.js +4 -11
- package/dist/dev/packages/@ember/debug/index.js +2 -1
- package/dist/dev/packages/@ember/debug/lib/deprecate.js +1 -1
- package/dist/dev/packages/@ember/engine/index.js +3 -29
- package/dist/dev/packages/@ember/engine/instance.js +3 -8
- package/dist/dev/packages/@ember/helper/index.js +211 -19
- package/dist/dev/packages/@ember/instrumentation/index.js +1 -1
- package/dist/dev/packages/@ember/modifier/index.js +2 -16
- package/dist/dev/packages/@ember/modifier/on.js +1 -9
- package/dist/dev/packages/@ember/object/-internals.js +3 -11
- package/dist/dev/packages/@ember/object/compat.js +3 -10
- package/dist/dev/packages/@ember/object/computed.js +2 -12
- package/dist/dev/packages/@ember/object/core.js +10 -18
- package/dist/dev/packages/@ember/object/evented.js +2 -12
- package/dist/dev/packages/@ember/object/events.js +1 -11
- package/dist/dev/packages/@ember/object/index.js +10 -14
- package/dist/dev/packages/@ember/object/internals.js +1 -1
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +6 -23
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -12
- package/dist/dev/packages/@ember/object/mixin.js +7 -10
- package/dist/dev/packages/@ember/object/observable.js +8 -12
- package/dist/dev/packages/@ember/object/observers.js +1 -11
- package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -13
- package/dist/dev/packages/@ember/object/proxy.js +0 -7
- package/dist/dev/packages/@ember/reactive/collections.js +589 -1
- package/dist/dev/packages/@ember/renderer/index.js +1 -14
- package/dist/dev/packages/@ember/routing/-internals.js +1 -10
- package/dist/dev/packages/@ember/routing/index.js +614 -14
- package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -11
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +7 -17
- package/dist/dev/packages/@ember/routing/lib/utils.js +2 -11
- package/dist/dev/packages/@ember/routing/route.js +12 -23
- package/dist/dev/packages/@ember/routing/router-service.js +8 -17
- package/dist/dev/packages/@ember/routing/router.js +5 -21
- package/dist/dev/packages/@ember/runloop/index.js +1 -10
- package/dist/dev/packages/@ember/service/index.js +1 -11
- package/dist/dev/packages/@ember/template/index.js +1 -14
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +14 -15
- package/dist/dev/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -1
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -42
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -3
- package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -10
- package/dist/dev/packages/@ember/template-factory/index.js +1 -8
- package/dist/dev/packages/@ember/utils/lib/compare.js +0 -7
- package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -12
- package/dist/dev/packages/@glimmer/manager/index.js +4 -314
- package/dist/dev/packages/@glimmer/node/index.js +3 -11
- package/dist/dev/packages/@glimmer/opcode-compiler/index.js +5 -7
- package/dist/dev/packages/@glimmer/program/index.js +194 -3
- package/dist/dev/packages/@glimmer/reference/index.js +4 -5
- package/dist/dev/packages/@glimmer/runtime/index.js +17 -10
- package/dist/dev/packages/@glimmer/tracking/index.js +2 -11
- package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -11
- package/dist/dev/packages/@glimmer/util/index.js +1 -2
- package/dist/dev/packages/@glimmer/validator/index.js +4 -1253
- package/dist/dev/packages/@glimmer/vm/index.js +1 -1
- package/dist/dev/packages/@glimmer/wire-format/index.js +3 -65
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/ember-template-compiler/index.js +7 -7
- package/dist/dev/packages/shared-chunks/{alias-CSC0WIbj.js → alias-ZcMQckQV.js} +8 -4
- package/dist/dev/packages/shared-chunks/api-AYt3zE12.js +310 -0
- package/dist/dev/packages/shared-chunks/{api-BqXkkT0p.js → api-WvJPuo9z.js} +4 -5
- package/dist/dev/packages/shared-chunks/{args-proxy-DgXMc9b5.js → args-proxy-BNLuRFlO.js} +2 -4
- package/dist/dev/packages/shared-chunks/{array-D8PfjQHi.js → array-Bh_kUjzy.js} +2 -1
- package/dist/dev/packages/shared-chunks/cache-B7dqAS38.js +596 -0
- package/dist/dev/packages/shared-chunks/{capabilities-O_xc7Yqk.js → capabilities-CZkuOqqC.js} +0 -5
- package/dist/dev/packages/shared-chunks/chain-tags-D6tuFUj_.js +190 -0
- package/dist/dev/packages/shared-chunks/{collections-D_nY_0UJ.js → collections-DPkjqeA3.js} +0 -1
- package/dist/dev/packages/shared-chunks/{compiler-D1leQ3Gl.js → compiler-CXB_8GdR.js} +7043 -234
- package/dist/dev/packages/shared-chunks/computed-CJnghmXC.js +980 -0
- package/dist/dev/packages/shared-chunks/container-BzzHmCNj.js +404 -0
- package/dist/dev/packages/shared-chunks/curly-CvC8E_4-.js +617 -0
- package/dist/dev/packages/shared-chunks/{fragment-Cc5k9Oy4.js → curried-BVwSNqpf.js} +5 -288
- package/dist/dev/packages/shared-chunks/decorator-B5Uh5NFI.js +135 -0
- package/dist/dev/packages/shared-chunks/element-C-QcIABg.js +109 -0
- package/dist/dev/packages/shared-chunks/element-builder-kHVx0F__.js +812 -0
- package/dist/dev/packages/shared-chunks/env-g-kaAFLN.js +161 -0
- package/dist/dev/packages/shared-chunks/events-6aFVjD4k.js +180 -0
- package/dist/dev/packages/shared-chunks/get-CpJjYeJO.js +138 -0
- package/dist/dev/packages/shared-chunks/get-debug-name-CSniHBsn.js +45 -0
- package/dist/dev/packages/shared-chunks/get_properties-CIm8IAtP.js +55 -0
- package/dist/dev/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
- package/dist/dev/packages/shared-chunks/hash-D3BENmhU.js +192 -0
- package/dist/dev/packages/shared-chunks/helper-DlC4YesW.js +314 -0
- package/dist/dev/packages/shared-chunks/index-CTxkmV78.js +2500 -0
- package/dist/dev/packages/shared-chunks/index-D-xTBV4B.js +220 -0
- package/dist/dev/packages/shared-chunks/{index-BUPd6pkm.js → index-DmGmwWPJ.js} +29 -29
- package/dist/dev/packages/shared-chunks/injected_property-B4T-FzZZ.js +70 -0
- package/dist/dev/packages/shared-chunks/intern-zquhAEIg.js +51 -0
- package/dist/dev/packages/shared-chunks/internal-CbQSKXEm.js +140 -0
- package/dist/dev/packages/shared-chunks/internal-helper-Dsl9_7H_.js +7 -0
- package/dist/dev/packages/shared-chunks/{invoke-CgfoEtMT.js → invoke-B6j6DdDz.js} +3 -7
- package/dist/{prod/packages/shared-chunks/is_proxy-Cr1qlMv_.js → dev/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
- package/dist/dev/packages/shared-chunks/libraries-CHBwbR72.js +79 -0
- package/dist/dev/packages/shared-chunks/mandatory-setter-BpbAMTzV.js +107 -0
- package/dist/dev/packages/shared-chunks/meta-BmRXesrk.js +46 -0
- package/dist/{prod/packages/shared-chunks/name-C68GLLO3.js → dev/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
- package/dist/dev/packages/shared-chunks/{namespace_search-uT8odThF.js → namespace_search-BfvzEQzN.js} +1 -2
- package/dist/dev/packages/shared-chunks/normalize-CKySQVU7.js +84 -0
- package/dist/dev/packages/shared-chunks/observers-C2DurkLG.js +199 -0
- package/dist/dev/packages/shared-chunks/on-D8QwT-eN.js +253 -0
- package/dist/dev/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
- package/dist/dev/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
- package/dist/dev/packages/shared-chunks/or-DBU9Ge4r.js +118 -0
- package/dist/{prod/packages/shared-chunks/program-B7SJZ5NF.js → dev/packages/shared-chunks/program-DzAfcWFj.js} +1 -1
- package/dist/dev/packages/shared-chunks/{program-context-sJz0oHOA.js → program-context-CqcQMsfa.js} +3 -3
- package/dist/dev/packages/shared-chunks/property_get-CIBS9umw.js +139 -0
- package/dist/dev/packages/shared-chunks/{property_set-DaoZXGM5.js → property_set-D3PKyisF.js} +4 -2
- package/dist/dev/packages/shared-chunks/props-fiqxqhAH.js +85 -0
- package/dist/dev/packages/shared-chunks/{reference-C3TKDRnP.js → reference-BoPB2LfI.js} +3 -4
- package/dist/dev/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
- package/dist/{prod/packages/shared-chunks/rehydrate-builder-CUefZL4I.js → dev/packages/shared-chunks/rehydrate-builder-DdzXTaJk.js} +7 -4
- package/dist/dev/packages/shared-chunks/{render-C1HzKUcM.js → render-DDdabL30.js} +510 -15
- package/dist/{prod/packages/shared-chunks/serialize-builder-DgpXSc2Q.js → dev/packages/shared-chunks/serialize-builder-B3u9Wr3n.js} +2 -7
- package/dist/dev/packages/shared-chunks/set_properties-BghuuGJx.js +48 -0
- package/dist/dev/packages/shared-chunks/{setup-registry-B7-RknRf.js → setup-registry-XxD0xvgf.js} +34 -14
- package/dist/dev/packages/shared-chunks/spec-BXl1reqK.js +16 -0
- package/dist/dev/packages/shared-chunks/super-BBBjgF69.js +91 -0
- package/dist/dev/packages/shared-chunks/template-BRrQR6KS.js +16 -0
- package/dist/dev/packages/shared-chunks/template-only-Yluyu0DY.js +78 -0
- package/dist/dev/packages/shared-chunks/textarea-C0Us0PNJ.js +468 -0
- package/dist/dev/packages/shared-chunks/tracked-CKE4wnE6.js +148 -0
- package/dist/dev/packages/shared-chunks/tracked-data-CGnA4ytZ.js +31 -0
- package/dist/dev/packages/shared-chunks/transform-resolutions-h1ik8gqW.js +645 -0
- package/dist/dev/packages/shared-chunks/unique-id-A83bjEE-.js +32 -0
- package/dist/{prod/packages/shared-chunks/on-CLxdmpmk.js → dev/packages/shared-chunks/untouchable-this-cH6_N2LJ.js} +215 -1397
- package/dist/dev/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
- package/dist/prod/packages/@ember/-internals/container/index.js +5 -315
- package/dist/prod/packages/@ember/-internals/deprecations/index.js +1 -1
- package/dist/prod/packages/@ember/-internals/environment/index.js +3 -148
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +14 -13
- package/dist/prod/packages/@ember/-internals/meta/lib/meta.js +1 -2
- package/dist/prod/packages/@ember/-internals/metal/index.js +19 -13
- package/dist/prod/packages/@ember/-internals/routing/index.js +2 -6
- package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -10
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -6
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -6
- package/dist/prod/packages/@ember/-internals/string/index.js +0 -2
- package/dist/prod/packages/@ember/-internals/utils/index.js +33 -30
- package/dist/prod/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -2
- package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -6
- package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -7
- package/dist/prod/packages/@ember/-internals/views/lib/system/utils.js +2 -2
- package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +1 -14
- package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +1 -2
- package/dist/prod/packages/@ember/application/index.js +5 -24
- package/dist/prod/packages/@ember/application/instance.js +6 -18
- package/dist/prod/packages/@ember/application/namespace.js +5 -8
- package/dist/prod/packages/@ember/array/index.js +8 -12
- package/dist/prod/packages/@ember/array/proxy.js +10 -10
- package/dist/prod/packages/@ember/canary-features/index.js +1 -1
- package/dist/prod/packages/@ember/component/helper.js +1 -12
- package/dist/prod/packages/@ember/component/index.js +1292 -15
- package/dist/prod/packages/@ember/component/template-only.js +1 -6
- package/dist/prod/packages/@ember/controller/index.js +3 -16
- package/dist/prod/packages/@ember/debug/container-debug-adapter.js +1 -15
- package/dist/prod/packages/@ember/debug/data-adapter.js +5 -7
- package/dist/prod/packages/@ember/debug/index.js +1 -0
- package/dist/prod/packages/@ember/debug/lib/deprecate.js +1 -1
- package/dist/prod/packages/@ember/engine/index.js +4 -25
- package/dist/prod/packages/@ember/engine/instance.js +4 -9
- package/dist/prod/packages/@ember/helper/index.js +211 -17
- package/dist/prod/packages/@ember/instrumentation/index.js +1 -1
- package/dist/prod/packages/@ember/modifier/index.js +2 -14
- package/dist/prod/packages/@ember/modifier/on.js +1 -6
- package/dist/prod/packages/@ember/object/-internals.js +3 -6
- package/dist/prod/packages/@ember/object/compat.js +4 -7
- package/dist/prod/packages/@ember/object/computed.js +2 -8
- package/dist/prod/packages/@ember/object/core.js +9 -15
- package/dist/prod/packages/@ember/object/evented.js +2 -7
- package/dist/prod/packages/@ember/object/events.js +1 -6
- package/dist/prod/packages/@ember/object/index.js +10 -12
- package/dist/prod/packages/@ember/object/internals.js +3 -6
- package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +6 -20
- package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -9
- package/dist/prod/packages/@ember/object/mixin.js +7 -9
- package/dist/prod/packages/@ember/object/observable.js +8 -9
- package/dist/prod/packages/@ember/object/observers.js +1 -6
- package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -9
- package/dist/prod/packages/@ember/object/proxy.js +0 -7
- package/dist/prod/packages/@ember/reactive/collections.js +589 -1
- package/dist/prod/packages/@ember/renderer/index.js +1 -12
- package/dist/prod/packages/@ember/routing/history-location.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +581 -12
- package/dist/prod/packages/@ember/routing/lib/dsl.js +1 -1
- package/dist/prod/packages/@ember/routing/lib/generate_controller.js +2 -6
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +5 -14
- package/dist/prod/packages/@ember/routing/lib/utils.js +2 -6
- package/dist/prod/packages/@ember/routing/none-location.js +1 -1
- package/dist/prod/packages/@ember/routing/route.js +12 -21
- package/dist/prod/packages/@ember/routing/router-service.js +6 -14
- package/dist/prod/packages/@ember/routing/router.js +5 -17
- package/dist/prod/packages/@ember/runloop/index.js +2 -6
- package/dist/prod/packages/@ember/service/index.js +1 -7
- package/dist/prod/packages/@ember/template/index.js +1 -12
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +15 -14
- package/dist/prod/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -2
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -42
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-in-element.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +127 -4
- package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -7
- package/dist/prod/packages/@ember/template-factory/index.js +1 -5
- package/dist/prod/packages/@ember/utils/lib/compare.js +1 -8
- package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -7
- package/dist/prod/packages/@glimmer/manager/index.js +4 -292
- package/dist/prod/packages/@glimmer/node/index.js +3 -8
- package/dist/prod/packages/@glimmer/opcode-compiler/index.js +5 -5
- package/dist/prod/packages/@glimmer/program/index.js +194 -3
- package/dist/prod/packages/@glimmer/reference/index.js +4 -4
- package/dist/prod/packages/@glimmer/runtime/index.js +16 -8
- package/dist/prod/packages/@glimmer/tracking/index.js +2 -7
- package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -6
- package/dist/prod/packages/@glimmer/util/index.js +2 -2
- package/dist/prod/packages/@glimmer/validator/index.js +5 -1016
- package/dist/prod/packages/@glimmer/vm/index.js +1 -1
- package/dist/prod/packages/@glimmer/wire-format/index.js +3 -65
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/ember-template-compiler/index.js +5 -7
- package/dist/prod/packages/shared-chunks/{alias-BLBQkche.js → alias-CLuFeKoV.js} +8 -6
- package/dist/prod/packages/shared-chunks/api-CM1trl_4.js +289 -0
- package/dist/prod/packages/shared-chunks/{api-DtWa0ZaF.js → api-zh_k31vb.js} +4 -5
- package/dist/prod/packages/shared-chunks/{args-proxy-Dl0A0YWI.js → args-proxy-BDXbXCF9.js} +2 -2
- package/dist/prod/packages/shared-chunks/{array-kVQfzrQn.js → array-DHdr4__s.js} +3 -3
- package/dist/prod/packages/shared-chunks/assert-CUCJBR2C.js +19 -0
- package/dist/prod/packages/shared-chunks/cache-BIlOoPA7.js +371 -0
- package/dist/prod/packages/shared-chunks/{capabilities-DXA-L0iT.js → capabilities-_5e35539.js} +0 -3
- package/dist/prod/packages/shared-chunks/chain-tags-BJqcuCM1.js +179 -0
- package/dist/prod/packages/shared-chunks/{compiler-Bbki2GT_.js → compiler-DjQtTQGk.js} +7045 -193
- package/dist/prod/packages/shared-chunks/{namespace_search-Dcdalhj6.js → computed-2Udcmflw.js} +109 -239
- package/dist/prod/packages/shared-chunks/container-D5NwW5Fd.js +316 -0
- package/dist/prod/packages/shared-chunks/curly-BsqvV8G0.js +546 -0
- package/dist/prod/packages/shared-chunks/{fragment-D7nBU9ae.js → curried-BVwSNqpf.js} +6 -303
- package/dist/prod/packages/shared-chunks/debug-render-tree-BLtnOSbb.js +2049 -0
- package/dist/prod/packages/shared-chunks/{decorator-BdDDBUd2.js → decorator-DBCISop4.js} +1 -1
- package/dist/prod/packages/shared-chunks/element-BjFr0tO0.js +101 -0
- package/dist/prod/packages/shared-chunks/{element-builder-BmLF0C-1.js → element-builder-BPjq0rxK.js} +109 -88
- package/dist/prod/packages/shared-chunks/env-DXxsTFkM.js +158 -0
- package/dist/prod/packages/shared-chunks/events-970OxD6Q.js +175 -0
- package/dist/prod/packages/shared-chunks/get-D5wxdTkY.js +138 -0
- package/dist/prod/packages/shared-chunks/get_properties-BcAC5sGx.js +55 -0
- package/dist/prod/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
- package/dist/prod/packages/shared-chunks/hash-DcUe-meU.js +192 -0
- package/dist/prod/packages/shared-chunks/helper-Da672z4a.js +299 -0
- package/dist/prod/packages/shared-chunks/{index-CjaDF9kC.js → index--2U-v2nf.js} +18 -10
- package/dist/prod/packages/shared-chunks/index-D-xTBV4B.js +220 -0
- package/dist/prod/packages/shared-chunks/index-D87qoERP.js +2322 -0
- package/dist/prod/packages/shared-chunks/{injected_property-CTVs5FPh.js → injected_property-D9B-fPiH.js} +3 -3
- package/dist/prod/packages/shared-chunks/intern-zquhAEIg.js +51 -0
- package/dist/prod/packages/shared-chunks/internal-DidurjJB.js +137 -0
- package/dist/prod/packages/shared-chunks/internal-helper-DIbr1RgC.js +7 -0
- package/dist/prod/packages/shared-chunks/{invoke-BdJCXD-b.js → invoke-Dr_CRwA_.js} +3 -5
- package/dist/{dev/packages/shared-chunks/is_proxy-B0smdQy8.js → prod/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
- package/dist/prod/packages/shared-chunks/libraries-DaXpIDYN.js +60 -0
- package/dist/prod/packages/shared-chunks/meta-B9mldqPL.js +36 -0
- package/dist/{dev/packages/shared-chunks/name-Z7dpqvzn.js → prod/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
- package/dist/prod/packages/shared-chunks/namespace_search-BfvzEQzN.js +134 -0
- package/dist/prod/packages/shared-chunks/normalize-D9jDJVGg.js +84 -0
- package/dist/prod/packages/shared-chunks/observers-Co4JALkS.js +199 -0
- package/dist/prod/packages/shared-chunks/on-C3ZQiUUD.js +228 -0
- package/dist/prod/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
- package/dist/prod/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
- package/dist/prod/packages/shared-chunks/or-oTVMuHc8.js +91 -0
- package/dist/{dev/packages/shared-chunks/program-DfV0v8aa.js → prod/packages/shared-chunks/program-B7CWdS8W.js} +1 -2
- package/dist/prod/packages/shared-chunks/{program-context-DFiwaPMR.js → program-context-CGMN-aQM.js} +3 -3
- package/dist/prod/packages/shared-chunks/property_get-hWJ0nGhW.js +122 -0
- package/dist/prod/packages/shared-chunks/{property_set-B2sZxeCw.js → property_set-Dj5-ScWk.js} +4 -5
- package/dist/prod/packages/shared-chunks/props-fiqxqhAH.js +85 -0
- package/dist/prod/packages/shared-chunks/{reference-BNqcwZWH.js → reference-BshxG6wn.js} +3 -3
- package/dist/prod/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
- package/dist/{dev/packages/shared-chunks/rehydrate-builder-CEk2KOIk.js → prod/packages/shared-chunks/rehydrate-builder-BKg2X6Lo.js} +7 -7
- package/dist/prod/packages/shared-chunks/{render-BlriW61t.js → render-nx5-PsDW.js} +487 -12
- package/dist/{dev/packages/shared-chunks/serialize-builder-CPKxdfiH.js → prod/packages/shared-chunks/serialize-builder-BGbC30SN.js} +2 -10
- package/dist/prod/packages/shared-chunks/set_properties-oPyURk67.js +48 -0
- package/dist/prod/packages/shared-chunks/{setup-registry-DeObnZ2Z.js → setup-registry-TiaKLj5k.js} +35 -13
- package/dist/prod/packages/shared-chunks/spec-BXl1reqK.js +16 -0
- package/dist/prod/packages/shared-chunks/super-BBBjgF69.js +91 -0
- package/dist/prod/packages/shared-chunks/template-BRrQR6KS.js +16 -0
- package/dist/prod/packages/shared-chunks/template-only-BtLl0uH0.js +78 -0
- package/dist/prod/packages/shared-chunks/textarea-CPKZ1c_O.js +455 -0
- package/dist/prod/packages/shared-chunks/{tracked-Cl5l4v8b.js → tracked-CffAABMz.js} +6 -4
- package/dist/prod/packages/shared-chunks/tracked-data-C83f5V5S.js +31 -0
- package/dist/prod/packages/shared-chunks/unique-id-CfHImDRV.js +32 -0
- package/dist/prod/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
- package/docs/data.json +1368 -1031
- package/package.json +1 -1
- package/types/stable/@ember/-internals/container/lib/registry.d.ts +1 -1
- package/types/stable/@ember/-internals/deprecations/index.d.ts +1 -1
- package/types/stable/@ember/-internals/environment/lib/env.d.ts +11 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/route-template.d.ts +2 -2
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +9 -7
- package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +3 -2
- package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +2 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +1 -1
- package/types/stable/@ember/-internals/meta/lib/meta.d.ts +3 -2
- package/types/stable/@ember/-internals/metal/lib/cache.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +3 -2
- package/types/stable/@ember/-internals/metal/lib/computed.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/observer.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/properties.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/tags.d.ts +2 -1
- package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +1 -1
- package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +1 -1
- package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +2 -2
- package/types/stable/@ember/-internals/views/lib/views/states.d.ts +1 -1
- package/types/stable/@ember/application/index.d.ts +5 -4
- package/types/stable/@ember/application/instance.d.ts +4 -3
- package/types/stable/@ember/application/namespace.d.ts +1 -1
- package/types/stable/@ember/array/proxy.d.ts +4 -3
- package/types/stable/@ember/component/helper.d.ts +1 -1
- package/types/stable/@ember/component/index.d.ts +6 -3
- package/types/stable/@ember/controller/index.d.ts +2 -2
- package/types/stable/@ember/debug/container-debug-adapter.d.ts +1 -1
- package/types/stable/@ember/engine/index.d.ts +3 -3
- package/types/stable/@ember/engine/instance.d.ts +4 -3
- package/types/stable/@ember/helper/index.d.ts +223 -3
- package/types/stable/@ember/modifier/index.d.ts +1 -1
- package/types/stable/@ember/object/-internals.d.ts +2 -2
- package/types/stable/@ember/object/compat.d.ts +2 -2
- package/types/stable/@ember/object/computed.d.ts +3 -1
- package/types/stable/@ember/object/evented.d.ts +1 -1
- package/types/stable/@ember/object/events.d.ts +1 -1
- package/types/stable/@ember/object/index.d.ts +8 -2
- package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +1 -1
- package/types/stable/@ember/object/mixin.d.ts +1 -1
- package/types/stable/@ember/object/observers.d.ts +1 -1
- package/types/stable/@ember/object/proxy.d.ts +1 -1
- package/types/stable/@ember/reactive/collections.d.ts +6 -6
- package/types/stable/@ember/renderer/index.d.ts +2 -2
- package/types/stable/@ember/routing/index.d.ts +1 -1
- package/types/stable/@ember/routing/lib/controller_for.d.ts +2 -2
- package/types/stable/@ember/routing/route.d.ts +2 -2
- package/types/stable/@ember/routing/router.d.ts +2 -2
- package/types/stable/@ember/service/index.d.ts +1 -1
- package/types/stable/@ember/template/index.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/dasherize-component-name.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-against-attrs.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-against-named-outlets.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/auto-import-builtins.d.ts +1 -4
- package/types/stable/@ember/template-compiler/lib/plugins/transform-action-syntax.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-each-in-into-each.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-each-track-array.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-in-element.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-resolutions.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/utils.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/system/calculate-location-display.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/types.d.ts +2 -1
- package/types/stable/@ember/template-factory/index.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/builder/builder-interface.d.ts +2 -2
- package/types/stable/@glimmer/compiler/lib/builder/builder.d.ts +2 -2
- package/types/stable/@glimmer/compiler/lib/compiler.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/context.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/index.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/impl.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/curry.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/dynamic-vars.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/has-block.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/if-unless.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/log.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/classified.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/component.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/simple-element.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/expressions.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/statements.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/strict-mode.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/2-encoding/expressions.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/2-encoding/mir.d.ts +3 -1
- package/types/stable/@glimmer/compiler/lib/shared/result.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/public/component.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/util/args-proxy.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/util/capabilities.d.ts +1 -1
- package/types/stable/@glimmer/node/lib/node-dom-helper.d.ts +1 -1
- package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/components.d.ts +1 -1
- package/types/stable/@glimmer/runtime/index.d.ts +9 -4
- package/types/stable/@glimmer/runtime/lib/compiled/expressions/concat.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/-debug-strip.d.ts +4 -3
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/component.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/dom.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/vm.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/curried-value.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/and.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/helpers/eq.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/gt.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/gte.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/invoke.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/lt.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/lte.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/neq.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/not.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/helpers/or.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/opcodes.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/references/class-list.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/references/curry-value.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/render.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/scope.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/append.d.ts +3 -2
- package/types/stable/@glimmer/runtime/lib/vm/arguments.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/vm/content/text.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/low-level.d.ts +2 -1
- package/types/stable/@glimmer/runtime/lib/vm/rehydrate-builder.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -1
- package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
- package/types/stable/@glimmer/tracking/index.d.ts +2 -1
- package/types/stable/@glimmer/tracking/primitives/cache.d.ts +1 -1
- package/types/stable/index.d.ts +9 -0
- package/dist/dev/packages/shared-chunks/constants-p7AL-pog.js +0 -213
- package/dist/dev/packages/shared-chunks/dynamic-BfDKO5NI.js +0 -3823
- package/dist/dev/packages/shared-chunks/element-builder-DO43ztVP.js +0 -404
- package/dist/dev/packages/shared-chunks/index-QZstta6s.js +0 -6306
- package/dist/dev/packages/shared-chunks/mandatory-setter-DHZe7-kW.js +0 -425
- package/dist/dev/packages/shared-chunks/observers-Bj9qLVau.js +0 -2062
- package/dist/dev/packages/shared-chunks/set_properties-kVGzZL_a.js +0 -100
- package/dist/dev/packages/shared-chunks/transform-resolutions-D-YtZ0_g.js +0 -7458
- package/dist/prod/packages/shared-chunks/constants-2M371WiB.js +0 -210
- package/dist/prod/packages/shared-chunks/index-6pnzcm45.js +0 -5931
- package/dist/prod/packages/shared-chunks/observers-tZ2aOzr4.js +0 -714
- package/dist/prod/packages/shared-chunks/set_properties-C1T46IiN.js +0 -101
- package/dist/prod/packages/shared-chunks/super-Cm_a_cLQ.js +0 -275
- package/dist/prod/packages/shared-chunks/transform-resolutions-DR4GLmR2.js +0 -6936
- package/dist/prod/packages/shared-chunks/{collections-GpG8lT2g.js → collections-C3Y8z_9v.js} +9 -9
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@module @ember/template
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
A wrapper around a string that has been marked as "trusted". **When
|
|
7
|
+
rendered in HTML, Ember will not perform any escaping.**
|
|
8
|
+
|
|
9
|
+
Note:
|
|
10
|
+
|
|
11
|
+
1. This does not *make* the string safe; it means that some code in your
|
|
12
|
+
application has *marked* it as trusted using the `trustHTML()` function.
|
|
13
|
+
|
|
14
|
+
2. The only public API for getting a `TrustedHTML` is calling `trustHTML()`. It
|
|
15
|
+
is *not* user-constructible.
|
|
16
|
+
|
|
17
|
+
If a string contains user inputs or other untrusted data, you must sanitize
|
|
18
|
+
the string before using the `trustHTML` method. Otherwise your code is
|
|
19
|
+
vulnerable to [Cross-Site Scripting][xss]. There are many open source
|
|
20
|
+
sanitization libraries to choose from, both for front end and server-side
|
|
21
|
+
sanitization.
|
|
22
|
+
|
|
23
|
+
[xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
import { trustHTML } from '@ember/template';
|
|
27
|
+
|
|
28
|
+
let someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
29
|
+
|
|
30
|
+
trustHTML(someTrustedorSanitizedString);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
@for @ember/template
|
|
34
|
+
@class TrustedHTML
|
|
35
|
+
@since 6.7.0
|
|
36
|
+
@public
|
|
37
|
+
*/
|
|
38
|
+
class TrustedHTML {
|
|
39
|
+
__string;
|
|
40
|
+
constructor(string) {
|
|
41
|
+
this.__string = string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
Get the string back to use as a string.
|
|
46
|
+
@public
|
|
47
|
+
@method toString
|
|
48
|
+
@returns {String} The string marked as trusted
|
|
49
|
+
*/
|
|
50
|
+
toString() {
|
|
51
|
+
return `${this.__string}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
Get the wrapped string as HTML to use without escaping.
|
|
56
|
+
@public
|
|
57
|
+
@method toHTML
|
|
58
|
+
@returns {String} the trusted string, without any escaping applied
|
|
59
|
+
*/
|
|
60
|
+
toHTML() {
|
|
61
|
+
return this.toString();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
A wrapper around a string that has been marked as safe ("trusted"). **When
|
|
67
|
+
rendered in HTML, Ember will not perform any escaping.**
|
|
68
|
+
|
|
69
|
+
Note:
|
|
70
|
+
|
|
71
|
+
1. This does not *make* the string safe; it means that some code in your
|
|
72
|
+
application has *marked* it as safe using the `htmlSafe()` function.
|
|
73
|
+
|
|
74
|
+
2. The only public API for getting a `SafeString` is calling `htmlSafe()`. It
|
|
75
|
+
is *not* user-constructible.
|
|
76
|
+
|
|
77
|
+
If a string contains user inputs or other untrusted data, you must sanitize
|
|
78
|
+
the string before using the `htmlSafe` method. Otherwise your code is
|
|
79
|
+
vulnerable to [Cross-Site Scripting][xss]. There are many open source
|
|
80
|
+
sanitization libraries to choose from, both for front end and server-side
|
|
81
|
+
sanitization.
|
|
82
|
+
|
|
83
|
+
[xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
import { htmlSafe } from '@ember/template';
|
|
87
|
+
|
|
88
|
+
let someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
89
|
+
|
|
90
|
+
htmlSafe(someTrustedorSanitizedString);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
@for @ember/template
|
|
94
|
+
@class SafeString
|
|
95
|
+
@since 4.12.0
|
|
96
|
+
@public
|
|
97
|
+
*/
|
|
98
|
+
const SafeString = TrustedHTML;
|
|
99
|
+
/**
|
|
100
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
101
|
+
when the string is used in a template. To say this another way,
|
|
102
|
+
strings marked with `htmlSafe` will not be HTML escaped.
|
|
103
|
+
|
|
104
|
+
A word of warning - The `htmlSafe` method does not make the string safe;
|
|
105
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
106
|
+
as HTML. If a string contains user inputs or other untrusted
|
|
107
|
+
data, you must sanitize the string before using the `htmlSafe` method.
|
|
108
|
+
Otherwise your code is vulnerable to
|
|
109
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
110
|
+
There are many open source sanitization libraries to choose from,
|
|
111
|
+
both for front end and server-side sanitization.
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
import { htmlSafe } from '@ember/template';
|
|
115
|
+
|
|
116
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
117
|
+
|
|
118
|
+
htmlSafe(someTrustedorSanitizedString)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
@method htmlSafe
|
|
122
|
+
@for @ember/template
|
|
123
|
+
@param str {String} The string to treat as trusted.
|
|
124
|
+
@static
|
|
125
|
+
@return {SafeString} A string that will not be HTML escaped by Handlebars.
|
|
126
|
+
@public
|
|
127
|
+
*/
|
|
128
|
+
const htmlSafe = trustHTML;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
132
|
+
without escaping when the string is used in a template. To say this another way,
|
|
133
|
+
strings marked with `trustHTML` will not be HTML escaped.
|
|
134
|
+
|
|
135
|
+
A word of warning - The `trustHTML` method does not make the string safe;
|
|
136
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
137
|
+
as HTML - that we trust its contents to be safe. If a string contains user inputs or other untrusted
|
|
138
|
+
data, you must sanitize the string before using the `trustHTML` method.
|
|
139
|
+
Otherwise your code is vulnerable to
|
|
140
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
141
|
+
There are many open source sanitization libraries to choose from,
|
|
142
|
+
both for front end and server-side sanitization.
|
|
143
|
+
|
|
144
|
+
```glimmer-js
|
|
145
|
+
import { trustHTML } from '@ember/template';
|
|
146
|
+
|
|
147
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
148
|
+
|
|
149
|
+
<template>
|
|
150
|
+
{{trustHTML someTrustedOrSanitizedString}}
|
|
151
|
+
</template>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
@method trustHTML
|
|
155
|
+
@for @ember/template
|
|
156
|
+
@param str {String} The string to treat as trusted.
|
|
157
|
+
@static
|
|
158
|
+
@return {TrustedHTML} A string that will not be HTML escaped by Handlebars.
|
|
159
|
+
@public
|
|
160
|
+
*/
|
|
161
|
+
function trustHTML(str) {
|
|
162
|
+
if (str === null || str === undefined) {
|
|
163
|
+
str = '';
|
|
164
|
+
} else if (typeof str !== 'string') {
|
|
165
|
+
str = String(str);
|
|
166
|
+
}
|
|
167
|
+
return new TrustedHTML(str);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
Detects if a string was decorated using `htmlSafe`.
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
import { htmlSafe, isHTMLSafe } from '@ember/template';
|
|
175
|
+
|
|
176
|
+
let plainString = 'plain string';
|
|
177
|
+
let safeString = htmlSafe('<div>someValue</div>');
|
|
178
|
+
|
|
179
|
+
isHTMLSafe(plainString); // false
|
|
180
|
+
isHTMLSafe(safeString); // true
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
@method isHTMLSafe
|
|
184
|
+
@for @ember/template
|
|
185
|
+
@static
|
|
186
|
+
@return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
|
|
187
|
+
@public
|
|
188
|
+
*/
|
|
189
|
+
const isHTMLSafe = isTrustedHTML;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
Detects if a string was decorated using `trustHTML`.
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
import { trustHTML, isTrustedHTML } from '@ember/template';
|
|
196
|
+
|
|
197
|
+
let plainString = 'plain string';
|
|
198
|
+
let safeString = trustHTML('<div>someValue</div>');
|
|
199
|
+
|
|
200
|
+
isTrustedHTML(plainString); // false
|
|
201
|
+
isTrustedHTML(safeString); // true
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
@method isTrustedHTML
|
|
205
|
+
@for @ember/template
|
|
206
|
+
@static
|
|
207
|
+
@return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
|
|
208
|
+
@public
|
|
209
|
+
*/
|
|
210
|
+
function isTrustedHTML(str) {
|
|
211
|
+
return (
|
|
212
|
+
// SAFETY: cast `as SafeString` only present to make this check "legal"; we
|
|
213
|
+
// can further improve this by changing the behavior to do an `in` check
|
|
214
|
+
// instead, but that's worth landing as a separate change for bisecting if
|
|
215
|
+
// it happens to have an impact on e.g. perf.
|
|
216
|
+
str !== null && typeof str === 'object' && typeof str.toHTML === 'function'
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { SafeString as S, TrustedHTML as T, isTrustedHTML as a, htmlSafe as h, isHTMLSafe as i, trustHTML as t };
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { z as VM_PRIMITIVE_OP, m as VM_RETURN_OP, aP as encodeHandle, aQ as isMachineOp, aF as VM_CONCAT_OP, aw as VM_GET_VARIABLE_OP, y as VM_CONSTANT_REFERENCE_OP, aA as VM_GET_PROPERTY_OP, aD as VM_HAS_BLOCK_OP, aC as VM_SPREAD_BLOCK_OP, N as VM_COMPILE_BLOCK_OP, aE as VM_HAS_BLOCK_PARAMS_OP, aG as VM_IF_INLINE_OP, aH as VM_NOT_OP, aI as VM_GET_DYNAMIC_VAR_OP, q as VM_PUSH_FRAME_OP, aJ as VM_LOG_OP, p as VM_POP_FRAME_OP, H as VM_FETCH_OP, D as VM_PRIMITIVE_REFERENCE_OP, av as VM_HELPER_OP, E as VM_DUP_OP, at as VM_DYNAMIC_HELPER_OP, F as VM_POP_OP, a9 as VM_CAPTURE_ARGS_OP, as as VM_CURRY_OP, aR as isSmallInt, aS as encodeImmediate, u as VM_PUSH_DYNAMIC_SCOPE_OP, I as VM_BIND_DYNAMIC_SCOPE_OP, v as VM_POP_DYNAMIC_SCOPE_OP, aB as VM_GET_BLOCK_OP, O as VM_INVOKE_YIELD_OP, t as VM_POP_SCOPE_OP, s as VM_CHILD_SCOPE_OP, ax as VM_SET_VARIABLE_OP, o as VM_INVOKE_VIRTUAL_OP, w as VM_CONSTANT_OP, M as VM_PUSH_BLOCK_SCOPE_OP, L as VM_PUSH_SYMBOL_TABLE_OP, a8 as VM_PUSH_EMPTY_ARGS_OP, a7 as VM_PUSH_ARGS_OP, J as VM_ENTER_OP, R as VM_JUMP_EQ_OP, n as VM_JUMP_OP, K as VM_EXIT_OP, l as VM_RETURN_TO_OP, Q as VM_JUMP_UNLESS_OP, a5 as VM_PUSH_COMPONENT_DEFINITION_OP, G as VM_LOAD_OP, ad as VM_BEGIN_COMPONENT_TRANSACTION_OP, ab as VM_CREATE_COMPONENT_OP, ac as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, ai as VM_GET_COMPONENT_SELF_OP, az as VM_ROOT_SCOPE_OP, ay as VM_SET_BLOCK_OP, aq as VM_DID_RENDER_LAYOUT_OP, ar as VM_COMMIT_COMPONENT_TRANSACTION_OP, aa as VM_PREPARE_ARGS_OP, am as VM_VIRTUAL_ROOT_SCOPE_OP, an as VM_SET_NAMED_VARIABLES_OP, ao as VM_SET_BLOCKS_OP, ap as VM_INVOKE_COMPONENT_LAYOUT_OP, ae as VM_PUT_COMPONENT_OPERATIONS_OP, X as VM_OPEN_DYNAMIC_ELEMENT_OP, ah as VM_DID_CREATE_ELEMENT_OP, _ as VM_FLUSH_ELEMENT_OP, $ as VM_CLOSE_ELEMENT_OP, f as VM_RESOLVE_CURRIED_COMPONENT_OP, a6 as VM_RESOLVE_DYNAMIC_COMPONENT_OP, g as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, ak as VM_GET_COMPONENT_LAYOUT_OP, al as VM_POPULATE_LAYOUT_OP, aj as VM_GET_COMPONENT_TAG_NAME_OP, U as VM_COMMENT_OP, a0 as VM_MODIFIER_OP, a1 as VM_DYNAMIC_MODIFIER_OP, a2 as VM_STATIC_ATTR_OP, ag as VM_STATIC_COMPONENT_ATTR_OP, a3 as VM_DYNAMIC_ATTR_OP, af as VM_COMPONENT_ATTR_OP, W as VM_OPEN_ELEMENT_OP, aL as VM_DEBUGGER_OP, T as VM_TEXT_OP, k as VM_INVOKE_STATIC_OP, aK as VM_DYNAMIC_CONTENT_TYPE_OP, Y as VM_PUSH_REMOTE_ELEMENT_OP, Z as VM_POP_REMOTE_ELEMENT_OP, S as VM_TO_BOOLEAN_OP, aM as VM_ENTER_LIST_OP, aO as VM_ITERATE_OP, aN as VM_EXIT_LIST_OP } from './fragment-Cc5k9Oy4.js';
|
|
2
|
-
import { d as debugToString } from './debug-to-string-CFb7h0lY.js';
|
|
3
|
-
import '../@glimmer/global-context/index.js';
|
|
4
|
-
import '../@glimmer/validator/index.js';
|
|
5
|
-
import './reference-C3TKDRnP.js';
|
|
6
|
-
import { a as assert } from './assert-CUCJBR2C.js';
|
|
7
|
-
import { e as expect, u as unwrap, S as StackImpl, d as dict } from './collections-D_nY_0UJ.js';
|
|
8
|
-
import { SexpOpcodes as opcodes } from '../@glimmer/wire-format/index.js';
|
|
9
|
-
import { e as $v0, c as $fp, $ as $s0, d as $sp, h as $s1 } from './registers-ylirb0dq.js';
|
|
10
|
-
import { b as EMPTY_STRING_ARRAY, E as EMPTY_ARRAY, e as enumerate, r as reverse } from './array-utils-CZQxrdD3.js';
|
|
11
|
-
import { ContentType } from '../@glimmer/vm/index.js';
|
|
12
|
-
import '../@glimmer/destroyable/index.js';
|
|
13
|
-
import { h as hasCapability } from './capabilities-O_xc7Yqk.js';
|
|
14
|
-
import { b as TYPE_SIZE, A as ARG_SHIFT, M as MACHINE_MASK, I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
|
|
15
1
|
import { a as assign } from './object-utils-AijlD-JH.js';
|
|
2
|
+
import { b as EMPTY_STRING_ARRAY, E as EMPTY_ARRAY, e as enumerate, r as reverse } from './array-utils-CZQxrdD3.js';
|
|
3
|
+
import { s as VM_PRIMITIVE_OP, aG as VM_RETURN_OP, aM as encodeHandle, aN as isMachineOp, aw as VM_CONCAT_OP, an as VM_GET_VARIABLE_OP, r as VM_CONSTANT_REFERENCE_OP, ar as VM_GET_PROPERTY_OP, au as VM_HAS_BLOCK_OP, at as VM_SPREAD_BLOCK_OP, F as VM_COMPILE_BLOCK_OP, av as VM_HAS_BLOCK_PARAMS_OP, ax as VM_IF_INLINE_OP, ay as VM_NOT_OP, az as VM_GET_DYNAMIC_VAR_OP, aK as VM_PUSH_FRAME_OP, aA as VM_LOG_OP, aJ as VM_POP_FRAME_OP, z as VM_FETCH_OP, v as VM_PRIMITIVE_REFERENCE_OP, am as VM_HELPER_OP, w as VM_DUP_OP, al as VM_DYNAMIC_HELPER_OP, x as VM_POP_OP, a0 as VM_CAPTURE_ARGS_OP, ak as VM_CURRY_OP, aO as isSmallInt, aP as encodeImmediate, n as VM_PUSH_DYNAMIC_SCOPE_OP, A as VM_BIND_DYNAMIC_SCOPE_OP, o as VM_POP_DYNAMIC_SCOPE_OP, as as VM_GET_BLOCK_OP, G as VM_INVOKE_YIELD_OP, m as VM_POP_SCOPE_OP, l as VM_CHILD_SCOPE_OP, ao as VM_SET_VARIABLE_OP, aI as VM_INVOKE_VIRTUAL_OP, p as VM_CONSTANT_OP, E as VM_PUSH_BLOCK_SCOPE_OP, D as VM_PUSH_SYMBOL_TABLE_OP, $ as VM_PUSH_EMPTY_ARGS_OP, _ as VM_PUSH_ARGS_OP, B as VM_ENTER_OP, J as VM_JUMP_EQ_OP, aH as VM_JUMP_OP, C as VM_EXIT_OP, aF as VM_RETURN_TO_OP, I as VM_JUMP_UNLESS_OP, Y as VM_PUSH_COMPONENT_DEFINITION_OP, y as VM_LOAD_OP, a4 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a2 as VM_CREATE_COMPONENT_OP, a3 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a9 as VM_GET_COMPONENT_SELF_OP, aq as VM_ROOT_SCOPE_OP, ap as VM_SET_BLOCK_OP, ah as VM_DID_RENDER_LAYOUT_OP, ai as VM_COMMIT_COMPONENT_TRANSACTION_OP, a1 as VM_PREPARE_ARGS_OP, ad as VM_VIRTUAL_ROOT_SCOPE_OP, ae as VM_SET_NAMED_VARIABLES_OP, af as VM_SET_BLOCKS_OP, ag as VM_INVOKE_COMPONENT_LAYOUT_OP, a5 as VM_PUT_COMPONENT_OPERATIONS_OP, O as VM_OPEN_DYNAMIC_ELEMENT_OP, a8 as VM_DID_CREATE_ELEMENT_OP, R as VM_FLUSH_ELEMENT_OP, S as VM_CLOSE_ELEMENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, Z as VM_RESOLVE_DYNAMIC_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, ab as VM_GET_COMPONENT_LAYOUT_OP, ac as VM_POPULATE_LAYOUT_OP, aa as VM_GET_COMPONENT_TAG_NAME_OP, M as VM_COMMENT_OP, T as VM_MODIFIER_OP, U as VM_DYNAMIC_MODIFIER_OP, W as VM_STATIC_ATTR_OP, a7 as VM_STATIC_COMPONENT_ATTR_OP, X as VM_DYNAMIC_ATTR_OP, a6 as VM_COMPONENT_ATTR_OP, N as VM_OPEN_ELEMENT_OP, aj as VM_DEBUGGER_OP, L as VM_TEXT_OP, j as VM_INVOKE_STATIC_OP, aB as VM_DYNAMIC_CONTENT_TYPE_OP, P as VM_PUSH_REMOTE_ELEMENT_OP, Q as VM_POP_REMOTE_ELEMENT_OP, K as VM_TO_BOOLEAN_OP, aC as VM_ENTER_LIST_OP, aE as VM_ITERATE_OP, aD as VM_EXIT_LIST_OP } from './opcode-metadata-9iSW5JGP.js';
|
|
4
|
+
import './curried-BVwSNqpf.js';
|
|
5
|
+
import './reference-BoPB2LfI.js';
|
|
6
|
+
import { e as expect, u as unwrap, S as StackImpl, d as dict } from './collections-DPkjqeA3.js';
|
|
16
7
|
import { i as isPresentArray } from './present-B1rrjAVM.js';
|
|
8
|
+
import { a as assert } from './assert-CUCJBR2C.js';
|
|
17
9
|
import { InstructionEncoderImpl } from '../@glimmer/encoder/index.js';
|
|
10
|
+
import { b as TYPE_SIZE, A as ARG_SHIFT, M as MACHINE_MASK, I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
|
|
11
|
+
import { d as debugToString } from './debug-to-string-CFb7h0lY.js';
|
|
12
|
+
import { o as opcodes } from './opcodes-CplRyHl_.js';
|
|
13
|
+
import { a as $v0, f as $fp, $ as $s0, e as $sp, d as $s1 } from './registers-DoamZwaG.js';
|
|
14
|
+
import { ContentType } from '../@glimmer/vm/index.js';
|
|
15
|
+
import { h as hasCapability } from './capabilities-CZkuOqqC.js';
|
|
18
16
|
|
|
19
17
|
function isGetLikeTuple(opcode) {
|
|
20
18
|
return Array.isArray(opcode) && opcode.length === 2;
|
|
@@ -48,10 +46,10 @@ function assertResolverInvariants(meta) {
|
|
|
48
46
|
* <Foo @arg={{true}} />
|
|
49
47
|
*/
|
|
50
48
|
function resolveComponent(resolver, constants, meta, [, expr, then]) {
|
|
51
|
-
|
|
49
|
+
assert(isGetFreeComponent(expr));
|
|
52
50
|
let type = expr[0];
|
|
53
51
|
if (expr[0] === opcodes.GetStrictKeyword) {
|
|
54
|
-
|
|
52
|
+
assert(!meta.isStrictMode);
|
|
55
53
|
throw new Error(`Attempted to resolve a component in a strict mode template, but that value was not in scope: ${
|
|
56
54
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
|
|
57
55
|
meta.symbols.upvars[expr[1]] ?? '{unknown variable}'}`);
|
|
@@ -76,7 +74,7 @@ function resolveComponent(resolver, constants, meta, [, expr, then]) {
|
|
|
76
74
|
let name = unwrap(upvars[expr[1]]);
|
|
77
75
|
let definition = resolver?.lookupComponent?.(name, owner) ?? null;
|
|
78
76
|
if ((typeof definition !== 'object' || definition === null)) {
|
|
79
|
-
|
|
77
|
+
assert(!meta.isStrictMode);
|
|
80
78
|
throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a component, but nothing was found.`);
|
|
81
79
|
}
|
|
82
80
|
|
|
@@ -90,7 +88,7 @@ function resolveComponent(resolver, constants, meta, [, expr, then]) {
|
|
|
90
88
|
* (helper arg)
|
|
91
89
|
*/
|
|
92
90
|
function resolveHelper(resolver, constants, meta, [, expr, then]) {
|
|
93
|
-
|
|
91
|
+
assert(isGetFreeHelper(expr));
|
|
94
92
|
let type = expr[0];
|
|
95
93
|
if (type === opcodes.GetLexicalSymbol) {
|
|
96
94
|
let {
|
|
@@ -110,7 +108,7 @@ function resolveHelper(resolver, constants, meta, [, expr, then]) {
|
|
|
110
108
|
let name = unwrap(upvars[expr[1]]);
|
|
111
109
|
let helper = resolver?.lookupHelper?.(name, owner) ?? null;
|
|
112
110
|
if (helper === null) {
|
|
113
|
-
|
|
111
|
+
assert(!meta.isStrictMode);
|
|
114
112
|
throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a helper, but nothing was found.`);
|
|
115
113
|
}
|
|
116
114
|
|
|
@@ -125,7 +123,7 @@ function resolveHelper(resolver, constants, meta, [, expr, then]) {
|
|
|
125
123
|
* <Foo {{modifier}}/>
|
|
126
124
|
*/
|
|
127
125
|
function resolveModifier(resolver, constants, meta, [, expr, then]) {
|
|
128
|
-
|
|
126
|
+
assert(isGetFreeModifier(expr));
|
|
129
127
|
let type = expr[0];
|
|
130
128
|
if (type === opcodes.GetLexicalSymbol) {
|
|
131
129
|
let {
|
|
@@ -145,7 +143,7 @@ function resolveModifier(resolver, constants, meta, [, expr, then]) {
|
|
|
145
143
|
let name = unwrap(upvars[expr[1]]);
|
|
146
144
|
let modifier = resolver?.lookupBuiltInModifier?.(name) ?? null;
|
|
147
145
|
if (modifier === null) {
|
|
148
|
-
|
|
146
|
+
assert(!meta.isStrictMode);
|
|
149
147
|
throw new Error(`Attempted to resolve a modifier in a strict mode template, but it was not in scope: ${name}`);
|
|
150
148
|
}
|
|
151
149
|
|
|
@@ -161,7 +159,7 @@ function resolveModifier(resolver, constants, meta, [, expr, then]) {
|
|
|
161
159
|
let name = unwrap(upvars[expr[1]]);
|
|
162
160
|
let modifier = resolver?.lookupModifier?.(name, owner) ?? null;
|
|
163
161
|
if (modifier === null) {
|
|
164
|
-
|
|
162
|
+
assert(!meta.isStrictMode);
|
|
165
163
|
throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a modifier, but nothing was found.`);
|
|
166
164
|
}
|
|
167
165
|
|
|
@@ -177,7 +175,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
177
175
|
ifComponent,
|
|
178
176
|
ifHelper
|
|
179
177
|
}]) {
|
|
180
|
-
|
|
178
|
+
assert(isGetFreeComponentOrHelper(expr));
|
|
181
179
|
let type = expr[0];
|
|
182
180
|
if (type === opcodes.GetLexicalSymbol) {
|
|
183
181
|
let {
|
|
@@ -195,7 +193,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
195
193
|
}
|
|
196
194
|
let helper = constants.helper(definition, null, true);
|
|
197
195
|
if (helper === null) {
|
|
198
|
-
|
|
196
|
+
assert(!meta.isStrictMode);
|
|
199
197
|
throw new Error(
|
|
200
198
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
|
|
201
199
|
`Attempted to use a value as either a component or helper, but it did not have a component manager or helper manager associated with it. The value was: ${debugToString(definition)}`);
|
|
@@ -217,7 +215,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
217
215
|
} else {
|
|
218
216
|
let helper = resolver?.lookupHelper?.(name, owner) ?? null;
|
|
219
217
|
if (helper === null) {
|
|
220
|
-
|
|
218
|
+
assert(!meta.isStrictMode);
|
|
221
219
|
throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a component or helper, but nothing was found.`);
|
|
222
220
|
}
|
|
223
221
|
|
|
@@ -235,7 +233,7 @@ function resolveOptionalComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
235
233
|
ifHelper,
|
|
236
234
|
ifValue
|
|
237
235
|
}]) {
|
|
238
|
-
|
|
236
|
+
assert(isGetFreeComponentOrHelper(expr));
|
|
239
237
|
let type = expr[0];
|
|
240
238
|
if (type === opcodes.GetLexicalSymbol) {
|
|
241
239
|
let {
|
|
@@ -292,7 +290,9 @@ function lookupBuiltInHelper(expr, resolver, meta, constants, type) {
|
|
|
292
290
|
let name = unwrap(upvars[expr[1]]);
|
|
293
291
|
let helper = resolver?.lookupBuiltInHelper?.(name) ?? null;
|
|
294
292
|
if (helper === null) {
|
|
295
|
-
|
|
293
|
+
assert(!meta.isStrictMode);
|
|
294
|
+
|
|
295
|
+
// Keyword helper did not exist, which means that we're attempting to use a
|
|
296
296
|
// value of some kind that is not in scope
|
|
297
297
|
throw new Error(`Attempted to resolve a ${type} in a strict mode template, but that value was not in scope: ${
|
|
298
298
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
|
|
@@ -404,7 +404,7 @@ class Labels {
|
|
|
404
404
|
} of targets) {
|
|
405
405
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
|
|
406
406
|
let address = labels[target] - at;
|
|
407
|
-
|
|
407
|
+
assert(heap.getbyaddr(at) === -1);
|
|
408
408
|
heap.setbyaddr(at, address);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
@@ -568,7 +568,7 @@ class Compilers {
|
|
|
568
568
|
let name = sexp[0];
|
|
569
569
|
let index = unwrap(this.names[name]);
|
|
570
570
|
let func = this.funcs[index];
|
|
571
|
-
|
|
571
|
+
assert(func, `expected an implementation for ${sexp[0]}`);
|
|
572
572
|
func(op, sexp);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { getOwner } from '../@ember/-internals/owner/index.js';
|
|
2
|
+
import '../@ember/debug/index.js';
|
|
3
|
+
import { c as computed, d as defineProperty } from './computed-CJnghmXC.js';
|
|
4
|
+
import { i as isElementDescriptor } from './decorator-B5Uh5NFI.js';
|
|
5
|
+
import { assert } from '../@ember/debug/lib/assert.js';
|
|
6
|
+
|
|
7
|
+
let DEBUG_INJECTION_FUNCTIONS;
|
|
8
|
+
{
|
|
9
|
+
DEBUG_INJECTION_FUNCTIONS = new WeakMap();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
@module ember
|
|
14
|
+
@private
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Read-only property that returns the result of a container lookup.
|
|
19
|
+
|
|
20
|
+
@class InjectedProperty
|
|
21
|
+
@namespace Ember
|
|
22
|
+
@constructor
|
|
23
|
+
@param {String} type The container type the property will lookup
|
|
24
|
+
@param {String} nameOrDesc (optional) The name the property will lookup, defaults
|
|
25
|
+
to the property's name
|
|
26
|
+
@private
|
|
27
|
+
*/
|
|
28
|
+
// Decorator factory (with args)
|
|
29
|
+
// (Also matches non-decorator form, types may be incorrect for this.)
|
|
30
|
+
|
|
31
|
+
// Non-decorator
|
|
32
|
+
|
|
33
|
+
// Decorator (without args)
|
|
34
|
+
|
|
35
|
+
// Catch-all for service and controller injections
|
|
36
|
+
|
|
37
|
+
function inject(type, ...args) {
|
|
38
|
+
(!(typeof type === 'string') && assert('a string type must be provided to inject', typeof type === 'string'));
|
|
39
|
+
let elementDescriptor;
|
|
40
|
+
let name;
|
|
41
|
+
if (isElementDescriptor(args)) {
|
|
42
|
+
elementDescriptor = args;
|
|
43
|
+
} else if (typeof args[0] === 'string') {
|
|
44
|
+
name = args[0];
|
|
45
|
+
}
|
|
46
|
+
let getInjection = function (propertyName) {
|
|
47
|
+
let owner = getOwner(this) || this.container; // fallback to `container` for backwards compat
|
|
48
|
+
(!(Boolean(owner)) && assert(`Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.`, Boolean(owner)));
|
|
49
|
+
return owner.lookup(`${type}:${name || propertyName}`);
|
|
50
|
+
};
|
|
51
|
+
{
|
|
52
|
+
DEBUG_INJECTION_FUNCTIONS.set(getInjection, {
|
|
53
|
+
type,
|
|
54
|
+
name
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
let decorator = computed({
|
|
58
|
+
get: getInjection,
|
|
59
|
+
set(keyName, value) {
|
|
60
|
+
defineProperty(this, keyName, null, value);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (elementDescriptor) {
|
|
64
|
+
return decorator(elementDescriptor[0], elementDescriptor[1], elementDescriptor[2]);
|
|
65
|
+
} else {
|
|
66
|
+
return decorator;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { DEBUG_INJECTION_FUNCTIONS as D, inject as i };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Strongly hint runtimes to intern the provided string.
|
|
3
|
+
|
|
4
|
+
When do I need to use this function?
|
|
5
|
+
|
|
6
|
+
For the most part, never. Pre-mature optimization is bad, and often the
|
|
7
|
+
runtime does exactly what you need it to, and more often the trade-off isn't
|
|
8
|
+
worth it.
|
|
9
|
+
|
|
10
|
+
Why?
|
|
11
|
+
|
|
12
|
+
Runtimes store strings in at least 2 different representations:
|
|
13
|
+
Ropes and Symbols (interned strings). The Rope provides a memory efficient
|
|
14
|
+
data-structure for strings created from concatenation or some other string
|
|
15
|
+
manipulation like splitting.
|
|
16
|
+
|
|
17
|
+
Unfortunately checking equality of different ropes can be quite costly as
|
|
18
|
+
runtimes must resort to clever string comparison algorithms. These
|
|
19
|
+
algorithms typically cost in proportion to the length of the string.
|
|
20
|
+
Luckily, this is where the Symbols (interned strings) shine. As Symbols are
|
|
21
|
+
unique by their string content, equality checks can be done by pointer
|
|
22
|
+
comparison.
|
|
23
|
+
|
|
24
|
+
How do I know if my string is a rope or symbol?
|
|
25
|
+
|
|
26
|
+
Typically (warning general sweeping statement, but truthy in runtimes at
|
|
27
|
+
present) static strings created as part of the JS source are interned.
|
|
28
|
+
Strings often used for comparisons can be interned at runtime if some
|
|
29
|
+
criteria are met. One of these criteria can be the size of the entire rope.
|
|
30
|
+
For example, in chrome 38 a rope longer then 12 characters will not
|
|
31
|
+
intern, nor will segments of that rope.
|
|
32
|
+
|
|
33
|
+
Some numbers: http://jsperf.com/eval-vs-keys/8
|
|
34
|
+
|
|
35
|
+
Known Trick™
|
|
36
|
+
|
|
37
|
+
@private
|
|
38
|
+
@return {String} interned version of the provided string
|
|
39
|
+
*/
|
|
40
|
+
function intern(str) {
|
|
41
|
+
let obj = Object.create(null);
|
|
42
|
+
obj[str] = 1;
|
|
43
|
+
for (let key in obj) {
|
|
44
|
+
if (key === str) {
|
|
45
|
+
return key;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return str;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { intern as i };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { setOwner } from '../@ember/-internals/owner/index.js';
|
|
2
|
+
import { g as guidFor } from './guid-Cbq2sNV_.js';
|
|
3
|
+
import '../@ember/debug/index.js';
|
|
4
|
+
import { s as setComponentTemplate } from './template-kM-7TTcc.js';
|
|
5
|
+
import { s as setInternalComponentManager } from './api-WvJPuo9z.js';
|
|
6
|
+
import { v as valueForRef, i as isConstRef, c as createConstRef } from './reference-BoPB2LfI.js';
|
|
7
|
+
import { x as untrack } from './cache-B7dqAS38.js';
|
|
8
|
+
import { assert } from '../@ember/debug/lib/assert.js';
|
|
9
|
+
|
|
10
|
+
function NOOP() {}
|
|
11
|
+
class InternalComponent {
|
|
12
|
+
// Override this
|
|
13
|
+
static toString() {
|
|
14
|
+
return 'internal component';
|
|
15
|
+
}
|
|
16
|
+
constructor(owner, args, caller) {
|
|
17
|
+
this.owner = owner;
|
|
18
|
+
this.args = args;
|
|
19
|
+
this.caller = caller;
|
|
20
|
+
setOwner(this, owner);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The default HTML id attribute. We don't really _need_ one, this is just
|
|
25
|
+
* added for compatibility as it's hard to tell if people rely on it being
|
|
26
|
+
* present, and it doens't really hurt.
|
|
27
|
+
*
|
|
28
|
+
* However, don't rely on this internally, like passing it to `getElementId`.
|
|
29
|
+
* This can be (and often is) overriden by passing an `id` attribute on the
|
|
30
|
+
* invocation, which shadows this default id via `...attributes`.
|
|
31
|
+
*/
|
|
32
|
+
get id() {
|
|
33
|
+
return guidFor(this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The default HTML class attribute. Similar to the above, we don't _need_
|
|
38
|
+
* them, they are just added for compatibility as it's similarly hard to tell
|
|
39
|
+
* if people rely on it in their CSS etc, and it doens't really hurt.
|
|
40
|
+
*/
|
|
41
|
+
get class() {
|
|
42
|
+
return 'ember-view';
|
|
43
|
+
}
|
|
44
|
+
validateArguments() {
|
|
45
|
+
for (let name of Object.keys(this.args.named)) {
|
|
46
|
+
if (!this.isSupportedArgument(name)) {
|
|
47
|
+
this.onUnsupportedArgument(name);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
named(name) {
|
|
52
|
+
let ref = this.args.named[name];
|
|
53
|
+
return ref ? valueForRef(ref) : undefined;
|
|
54
|
+
}
|
|
55
|
+
positional(index) {
|
|
56
|
+
let ref = this.args.positional[index];
|
|
57
|
+
return ref ? valueForRef(ref) : undefined;
|
|
58
|
+
}
|
|
59
|
+
listenerFor(name) {
|
|
60
|
+
let listener = this.named(name);
|
|
61
|
+
if (listener) {
|
|
62
|
+
(!(typeof listener === 'function') && assert(`The \`@${name}\` argument to the <${this.constructor}> component must be a function`, typeof listener === 'function'));
|
|
63
|
+
return listener;
|
|
64
|
+
} else {
|
|
65
|
+
return NOOP;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
isSupportedArgument(_name) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
onUnsupportedArgument(_name) {}
|
|
72
|
+
toString() {
|
|
73
|
+
return `<${this.constructor}:${guidFor(this)}>`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const OPAQUE_CONSTRUCTOR_MAP = new WeakMap();
|
|
77
|
+
function opaquify(constructor, template) {
|
|
78
|
+
let _opaque = {
|
|
79
|
+
// Factory interface
|
|
80
|
+
create() {
|
|
81
|
+
throw assert('Use constructor instead of create');
|
|
82
|
+
},
|
|
83
|
+
toString() {
|
|
84
|
+
return constructor.toString();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
let opaque = _opaque;
|
|
88
|
+
OPAQUE_CONSTRUCTOR_MAP.set(opaque, constructor);
|
|
89
|
+
setInternalComponentManager(INTERNAL_COMPONENT_MANAGER, opaque);
|
|
90
|
+
setComponentTemplate(template, opaque);
|
|
91
|
+
return opaque;
|
|
92
|
+
}
|
|
93
|
+
function deopaquify(opaque) {
|
|
94
|
+
let constructor = OPAQUE_CONSTRUCTOR_MAP.get(opaque);
|
|
95
|
+
(!(constructor) && assert(`[BUG] Invalid internal component constructor: ${opaque}`, constructor));
|
|
96
|
+
return constructor;
|
|
97
|
+
}
|
|
98
|
+
const CAPABILITIES = {
|
|
99
|
+
dynamicLayout: false,
|
|
100
|
+
dynamicTag: false,
|
|
101
|
+
prepareArgs: false,
|
|
102
|
+
createArgs: true,
|
|
103
|
+
attributeHook: false,
|
|
104
|
+
elementHook: false,
|
|
105
|
+
createCaller: true,
|
|
106
|
+
dynamicScope: false,
|
|
107
|
+
updateHook: false,
|
|
108
|
+
createInstance: true,
|
|
109
|
+
wrapped: false,
|
|
110
|
+
willDestroy: false,
|
|
111
|
+
hasSubOwner: false
|
|
112
|
+
};
|
|
113
|
+
class InternalManager {
|
|
114
|
+
getCapabilities() {
|
|
115
|
+
return CAPABILITIES;
|
|
116
|
+
}
|
|
117
|
+
create(owner, definition, args, _env, _dynamicScope, caller) {
|
|
118
|
+
(!(isConstRef(caller)) && assert('caller must be const', isConstRef(caller)));
|
|
119
|
+
let ComponentClass = deopaquify(definition);
|
|
120
|
+
let instance = new ComponentClass(owner, args.capture(), valueForRef(caller));
|
|
121
|
+
untrack(instance['validateArguments'].bind(instance));
|
|
122
|
+
return instance;
|
|
123
|
+
}
|
|
124
|
+
didCreate() {}
|
|
125
|
+
didUpdate() {}
|
|
126
|
+
didRenderLayout() {}
|
|
127
|
+
didUpdateLayout() {}
|
|
128
|
+
getDebugName(definition) {
|
|
129
|
+
return definition.toString();
|
|
130
|
+
}
|
|
131
|
+
getSelf(instance) {
|
|
132
|
+
return createConstRef(instance, 'this');
|
|
133
|
+
}
|
|
134
|
+
getDestroyable(instance) {
|
|
135
|
+
return instance;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const INTERNAL_COMPONENT_MANAGER = new InternalManager();
|
|
139
|
+
|
|
140
|
+
export { InternalComponent as I, opaquify as o };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { isDestroying, isDestroyed, associateDestroyableChild } from '../@glimmer/destroyable/index.js';
|
|
2
|
-
import {
|
|
3
|
-
import '../@glimmer/global-context/index.js';
|
|
4
|
-
import './debug-to-string-CFb7h0lY.js';
|
|
5
|
-
import { createCache, getValue } from '../@glimmer/validator/index.js';
|
|
6
|
-
import './reference-C3TKDRnP.js';
|
|
7
|
-
import './capabilities-O_xc7Yqk.js';
|
|
2
|
+
import { a as getInternalHelperManager, f as hasValue, h as hasDestroyable } from './api-WvJPuo9z.js';
|
|
8
3
|
import { getOwner } from '../@glimmer/owner/index.js';
|
|
9
|
-
import {
|
|
4
|
+
import { l as createCache, r as getValue } from './cache-B7dqAS38.js';
|
|
5
|
+
import { E as EMPTY_ARGS, a as EMPTY_NAMED, b as EMPTY_POSITIONAL } from './untouchable-this-cH6_N2LJ.js';
|
|
10
6
|
|
|
11
7
|
let ARGS_CACHES = new WeakMap() ;
|
|
12
8
|
function getArgs(proxy) {
|