discourse-ember-source 3.5.1.1 → 3.5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (741) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ember/version.rb +1 -1
  3. metadata +2 -740
  4. data/.gitignore +0 -9
  5. data/.travis.yml +0 -5
  6. data/Gemfile +0 -6
  7. data/LICENSE.txt +0 -21
  8. data/README +0 -18
  9. data/README.md +0 -39
  10. data/Rakefile +0 -27
  11. data/bin/console +0 -14
  12. data/bin/setup +0 -8
  13. data/discourse-ember-source-3.5.1.0.gem +0 -0
  14. data/dist/ember-all.debug.map +0 -1
  15. data/dist/ember-template-compiler.map +0 -1
  16. data/dist/ember-testing.map +0 -1
  17. data/dist/ember-tests.map +0 -1
  18. data/dist/ember-tests.prod.map +0 -1
  19. data/dist/ember.debug.map +0 -1
  20. data/dist/ember.min.map +0 -1
  21. data/dist/ember.prod.map +0 -1
  22. data/dist/es/@ember/application/globals-resolver.js +0 -425
  23. data/dist/es/@ember/application/index.js +0 -3
  24. data/dist/es/@ember/application/instance.js +0 -513
  25. data/dist/es/@ember/application/lib/application.js +0 -1139
  26. data/dist/es/@ember/application/lib/lazy_load.js +0 -69
  27. data/dist/es/@ember/application/lib/validate-type.js +0 -24
  28. data/dist/es/@ember/application/tests/application_instance_test.js +0 -230
  29. data/dist/es/@ember/application/tests/application_test.js +0 -470
  30. data/dist/es/@ember/application/tests/bootstrap-test.js +0 -28
  31. data/dist/es/@ember/application/tests/dependency_injection/custom_resolver_test.js +0 -32
  32. data/dist/es/@ember/application/tests/dependency_injection/default_resolver_test.js +0 -363
  33. data/dist/es/@ember/application/tests/dependency_injection/normalization_test.js +0 -70
  34. data/dist/es/@ember/application/tests/dependency_injection/to_string_test.js +0 -71
  35. data/dist/es/@ember/application/tests/dependency_injection_test.js +0 -93
  36. data/dist/es/@ember/application/tests/initializers_test.js +0 -391
  37. data/dist/es/@ember/application/tests/instance_initializers_test.js +0 -395
  38. data/dist/es/@ember/application/tests/lazy_load_test.js +0 -79
  39. data/dist/es/@ember/application/tests/logging_test.js +0 -179
  40. data/dist/es/@ember/application/tests/readiness_test.js +0 -138
  41. data/dist/es/@ember/application/tests/reset_test.js +0 -185
  42. data/dist/es/@ember/application/tests/visit_test.js +0 -783
  43. data/dist/es/@ember/canary-features/index.js +0 -76
  44. data/dist/es/@ember/controller/index.js +0 -50
  45. data/dist/es/@ember/controller/lib/controller_mixin.js +0 -42
  46. data/dist/es/@ember/controller/tests/controller_test.js +0 -209
  47. data/dist/es/@ember/debug/index.js +0 -264
  48. data/dist/es/@ember/debug/lib/deprecate.js +0 -198
  49. data/dist/es/@ember/debug/lib/handlers.js +0 -22
  50. data/dist/es/@ember/debug/lib/testing.js +0 -7
  51. data/dist/es/@ember/debug/lib/warn.js +0 -107
  52. data/dist/es/@ember/debug/tests/handlers-test.js +0 -144
  53. data/dist/es/@ember/debug/tests/main_test.js +0 -444
  54. data/dist/es/@ember/deprecated-features/index.js +0 -21
  55. data/dist/es/@ember/engine/index.js +0 -532
  56. data/dist/es/@ember/engine/instance.js +0 -228
  57. data/dist/es/@ember/engine/lib/engine-parent.js +0 -32
  58. data/dist/es/@ember/engine/tests/engine_initializers_test.js +0 -366
  59. data/dist/es/@ember/engine/tests/engine_instance_initializers_test.js +0 -409
  60. data/dist/es/@ember/engine/tests/engine_instance_test.js +0 -115
  61. data/dist/es/@ember/engine/tests/engine_parent_test.js +0 -20
  62. data/dist/es/@ember/engine/tests/engine_test.js +0 -121
  63. data/dist/es/@ember/error/index.js +0 -36
  64. data/dist/es/@ember/error/tests/index_test.js +0 -19
  65. data/dist/es/@ember/instrumentation/index.js +0 -240
  66. data/dist/es/@ember/instrumentation/tests/index-test.js +0 -214
  67. data/dist/es/@ember/map/index.js +0 -218
  68. data/dist/es/@ember/map/lib/ordered-set.js +0 -186
  69. data/dist/es/@ember/map/lib/utils.js +0 -29
  70. data/dist/es/@ember/map/tests/map_test.js +0 -578
  71. data/dist/es/@ember/map/with-default.js +0 -87
  72. data/dist/es/@ember/object/computed.js +0 -35
  73. data/dist/es/@ember/object/lib/computed/computed_macros.js +0 -742
  74. data/dist/es/@ember/object/lib/computed/reduce_computed_macros.js +0 -894
  75. data/dist/es/@ember/object/tests/computed/computed_macros_test.js +0 -533
  76. data/dist/es/@ember/object/tests/computed/reduce_computed_macros_test.js +0 -2243
  77. data/dist/es/@ember/polyfills/index.js +0 -3
  78. data/dist/es/@ember/polyfills/lib/assign.js +0 -43
  79. data/dist/es/@ember/polyfills/lib/merge.js +0 -35
  80. data/dist/es/@ember/polyfills/tests/assign_test.js +0 -64
  81. data/dist/es/@ember/runloop/index.js +0 -749
  82. data/dist/es/@ember/runloop/tests/debounce_test.js +0 -87
  83. data/dist/es/@ember/runloop/tests/later_test.js +0 -264
  84. data/dist/es/@ember/runloop/tests/next_test.js +0 -56
  85. data/dist/es/@ember/runloop/tests/once_test.js +0 -62
  86. data/dist/es/@ember/runloop/tests/onerror_test.js +0 -59
  87. data/dist/es/@ember/runloop/tests/run_bind_test.js +0 -59
  88. data/dist/es/@ember/runloop/tests/run_test.js +0 -28
  89. data/dist/es/@ember/runloop/tests/schedule_test.js +0 -86
  90. data/dist/es/@ember/runloop/tests/sync_test.js +0 -32
  91. data/dist/es/@ember/runloop/tests/unwind_test.js +0 -54
  92. data/dist/es/@ember/service/index.js +0 -57
  93. data/dist/es/@ember/string/index.js +0 -362
  94. data/dist/es/@ember/string/lib/string_registry.js +0 -13
  95. data/dist/es/@ember/string/tests/camelize_test.js +0 -53
  96. data/dist/es/@ember/string/tests/capitalize_test.js +0 -58
  97. data/dist/es/@ember/string/tests/classify_test.js +0 -79
  98. data/dist/es/@ember/string/tests/dasherize_test.js +0 -57
  99. data/dist/es/@ember/string/tests/decamelize_test.js +0 -51
  100. data/dist/es/@ember/string/tests/loc_test.js +0 -76
  101. data/dist/es/@ember/string/tests/underscore_test.js +0 -51
  102. data/dist/es/@ember/string/tests/w_test.js +0 -39
  103. data/dist/es/@glimmer/compiler.js +0 -1226
  104. data/dist/es/@glimmer/encoder.js +0 -39
  105. data/dist/es/@glimmer/low-level.js +0 -82
  106. data/dist/es/@glimmer/node.js +0 -112
  107. data/dist/es/@glimmer/opcode-compiler.js +0 -1999
  108. data/dist/es/@glimmer/program.js +0 -405
  109. data/dist/es/@glimmer/reference.js +0 -478
  110. data/dist/es/@glimmer/runtime.js +0 -4086
  111. data/dist/es/@glimmer/syntax.js +0 -1424
  112. data/dist/es/@glimmer/util.js +0 -189
  113. data/dist/es/@glimmer/vm.js +0 -27
  114. data/dist/es/@glimmer/wire-format.js +0 -56
  115. data/dist/es/backburner.js +0 -936
  116. data/dist/es/container/index.js +0 -8
  117. data/dist/es/container/lib/container.js +0 -437
  118. data/dist/es/container/lib/registry.js +0 -646
  119. data/dist/es/container/tests/container_test.js +0 -872
  120. data/dist/es/container/tests/owner_test.js +0 -20
  121. data/dist/es/container/tests/registry_test.js +0 -943
  122. data/dist/es/dag-map.js +0 -209
  123. data/dist/es/ember-browser-environment/index.js +0 -8
  124. data/dist/es/ember-browser-environment/lib/has-dom.js +0 -19
  125. data/dist/es/ember-console/index.js +0 -177
  126. data/dist/es/ember-environment/index.js +0 -3
  127. data/dist/es/ember-environment/lib/context.js +0 -20
  128. data/dist/es/ember-environment/lib/env.js +0 -185
  129. data/dist/es/ember-environment/lib/global.js +0 -14
  130. data/dist/es/ember-error-handling/index.js +0 -22
  131. data/dist/es/ember-extension-support/index.js +0 -2
  132. data/dist/es/ember-extension-support/lib/container_debug_adapter.js +0 -99
  133. data/dist/es/ember-extension-support/lib/data_adapter.js +0 -493
  134. data/dist/es/ember-extension-support/tests/container_debug_adapter_test.js +0 -73
  135. data/dist/es/ember-extension-support/tests/data_adapter_test.js +0 -301
  136. data/dist/es/ember-glimmer/index.js +0 -286
  137. data/dist/es/ember-glimmer/lib/compile-time-lookup.js +0 -37
  138. data/dist/es/ember-glimmer/lib/component-managers/abstract.js +0 -49
  139. data/dist/es/ember-glimmer/lib/component-managers/curly.js +0 -395
  140. data/dist/es/ember-glimmer/lib/component-managers/custom.js +0 -145
  141. data/dist/es/ember-glimmer/lib/component-managers/definition-state.js +0 -1
  142. data/dist/es/ember-glimmer/lib/component-managers/mount.js +0 -103
  143. data/dist/es/ember-glimmer/lib/component-managers/outlet.js +0 -114
  144. data/dist/es/ember-glimmer/lib/component-managers/render.js +0 -112
  145. data/dist/es/ember-glimmer/lib/component-managers/root.js +0 -74
  146. data/dist/es/ember-glimmer/lib/component-managers/template-only.js +0 -46
  147. data/dist/es/ember-glimmer/lib/component.js +0 -633
  148. data/dist/es/ember-glimmer/lib/components/checkbox.js +0 -57
  149. data/dist/es/ember-glimmer/lib/components/link-to.js +0 -777
  150. data/dist/es/ember-glimmer/lib/components/text_area.js +0 -236
  151. data/dist/es/ember-glimmer/lib/components/text_field.js +0 -145
  152. data/dist/es/ember-glimmer/lib/dom.js +0 -3
  153. data/dist/es/ember-glimmer/lib/environment.js +0 -102
  154. data/dist/es/ember-glimmer/lib/helper.js +0 -128
  155. data/dist/es/ember-glimmer/lib/helpers/-class.js +0 -23
  156. data/dist/es/ember-glimmer/lib/helpers/-html-safe.js +0 -9
  157. data/dist/es/ember-glimmer/lib/helpers/-input-type.js +0 -11
  158. data/dist/es/ember-glimmer/lib/helpers/-normalize-class.js +0 -22
  159. data/dist/es/ember-glimmer/lib/helpers/action.js +0 -360
  160. data/dist/es/ember-glimmer/lib/helpers/component.js +0 -135
  161. data/dist/es/ember-glimmer/lib/helpers/concat.js +0 -38
  162. data/dist/es/ember-glimmer/lib/helpers/each-in.js +0 -126
  163. data/dist/es/ember-glimmer/lib/helpers/get.js +0 -100
  164. data/dist/es/ember-glimmer/lib/helpers/hash.js +0 -44
  165. data/dist/es/ember-glimmer/lib/helpers/if-unless.js +0 -142
  166. data/dist/es/ember-glimmer/lib/helpers/loc.js +0 -40
  167. data/dist/es/ember-glimmer/lib/helpers/log.js +0 -25
  168. data/dist/es/ember-glimmer/lib/helpers/mut.js +0 -107
  169. data/dist/es/ember-glimmer/lib/helpers/query-param.js +0 -31
  170. data/dist/es/ember-glimmer/lib/helpers/readonly.js +0 -104
  171. data/dist/es/ember-glimmer/lib/helpers/unbound.js +0 -36
  172. data/dist/es/ember-glimmer/lib/modifiers/action.js +0 -185
  173. data/dist/es/ember-glimmer/lib/protocol-for-url.js +0 -48
  174. data/dist/es/ember-glimmer/lib/renderer.js +0 -371
  175. data/dist/es/ember-glimmer/lib/resolver.js +0 -290
  176. data/dist/es/ember-glimmer/lib/setup-registry.js +0 -77
  177. data/dist/es/ember-glimmer/lib/syntax.js +0 -73
  178. data/dist/es/ember-glimmer/lib/syntax/-text-area.js +0 -8
  179. data/dist/es/ember-glimmer/lib/syntax/input.js +0 -173
  180. data/dist/es/ember-glimmer/lib/syntax/let.js +0 -50
  181. data/dist/es/ember-glimmer/lib/syntax/mount.js +0 -101
  182. data/dist/es/ember-glimmer/lib/syntax/outlet.js +0 -120
  183. data/dist/es/ember-glimmer/lib/syntax/render.js +0 -140
  184. data/dist/es/ember-glimmer/lib/syntax/utils.js +0 -6
  185. data/dist/es/ember-glimmer/lib/template-compiler.js +0 -7
  186. data/dist/es/ember-glimmer/lib/template.js +0 -16
  187. data/dist/es/ember-glimmer/lib/template_registry.js +0 -18
  188. data/dist/es/ember-glimmer/lib/templates/component.js +0 -2
  189. data/dist/es/ember-glimmer/lib/templates/empty.js +0 -2
  190. data/dist/es/ember-glimmer/lib/templates/link-to.js +0 -2
  191. data/dist/es/ember-glimmer/lib/templates/outlet.js +0 -2
  192. data/dist/es/ember-glimmer/lib/templates/root.js +0 -2
  193. data/dist/es/ember-glimmer/lib/utils/bindings.js +0 -180
  194. data/dist/es/ember-glimmer/lib/utils/curly-component-state-bucket.js +0 -36
  195. data/dist/es/ember-glimmer/lib/utils/custom-component-manager.js +0 -20
  196. data/dist/es/ember-glimmer/lib/utils/debug-stack.js +0 -57
  197. data/dist/es/ember-glimmer/lib/utils/iterable.js +0 -358
  198. data/dist/es/ember-glimmer/lib/utils/outlet.js +0 -89
  199. data/dist/es/ember-glimmer/lib/utils/process-args.js +0 -40
  200. data/dist/es/ember-glimmer/lib/utils/references.js +0 -325
  201. data/dist/es/ember-glimmer/lib/utils/serialization-first-node-helpers.js +0 -1
  202. data/dist/es/ember-glimmer/lib/utils/string.js +0 -98
  203. data/dist/es/ember-glimmer/lib/utils/to-bool.js +0 -9
  204. data/dist/es/ember-glimmer/lib/views/outlet.js +0 -71
  205. data/dist/es/ember-glimmer/tests/integration/application/actions-test.js +0 -107
  206. data/dist/es/ember-glimmer/tests/integration/application/engine-test.js +0 -912
  207. data/dist/es/ember-glimmer/tests/integration/application/rendering-test.js +0 -530
  208. data/dist/es/ember-glimmer/tests/integration/components/angle-bracket-invocation-test.js +0 -852
  209. data/dist/es/ember-glimmer/tests/integration/components/append-test.js +0 -742
  210. data/dist/es/ember-glimmer/tests/integration/components/attribute-bindings-test.js +0 -999
  211. data/dist/es/ember-glimmer/tests/integration/components/attrs-lookup-test.js +0 -268
  212. data/dist/es/ember-glimmer/tests/integration/components/class-bindings-test.js +0 -849
  213. data/dist/es/ember-glimmer/tests/integration/components/contextual-components-test.js +0 -1493
  214. data/dist/es/ember-glimmer/tests/integration/components/curly-components-test.js +0 -3705
  215. data/dist/es/ember-glimmer/tests/integration/components/destroy-test.js +0 -33
  216. data/dist/es/ember-glimmer/tests/integration/components/dynamic-components-test.js +0 -896
  217. data/dist/es/ember-glimmer/tests/integration/components/error-handling-test.js +0 -164
  218. data/dist/es/ember-glimmer/tests/integration/components/fragment-components-test.js +0 -285
  219. data/dist/es/ember-glimmer/tests/integration/components/instrumentation-compile-test.js +0 -108
  220. data/dist/es/ember-glimmer/tests/integration/components/instrumentation-test.js +0 -157
  221. data/dist/es/ember-glimmer/tests/integration/components/life-cycle-test.js +0 -1653
  222. data/dist/es/ember-glimmer/tests/integration/components/link-to-test.js +0 -218
  223. data/dist/es/ember-glimmer/tests/integration/components/local-lookup-test.js +0 -414
  224. data/dist/es/ember-glimmer/tests/integration/components/namespaced-lookup-test.js +0 -185
  225. data/dist/es/ember-glimmer/tests/integration/components/render-to-element-test.js +0 -0
  226. data/dist/es/ember-glimmer/tests/integration/components/target-action-test.js +0 -779
  227. data/dist/es/ember-glimmer/tests/integration/components/template-only-components-test.js +0 -225
  228. data/dist/es/ember-glimmer/tests/integration/components/to-string-test.js +0 -27
  229. data/dist/es/ember-glimmer/tests/integration/components/utils-test.js +0 -401
  230. data/dist/es/ember-glimmer/tests/integration/components/web-component-fallback-test.js +0 -35
  231. data/dist/es/ember-glimmer/tests/integration/components/will-destroy-element-hook-test.js +0 -40
  232. data/dist/es/ember-glimmer/tests/integration/content-test.js +0 -1759
  233. data/dist/es/ember-glimmer/tests/integration/custom-component-manager-test.js +0 -508
  234. data/dist/es/ember-glimmer/tests/integration/event-dispatcher-test.js +0 -607
  235. data/dist/es/ember-glimmer/tests/integration/helpers/-class-test.js +0 -76
  236. data/dist/es/ember-glimmer/tests/integration/helpers/closure-action-test.js +0 -1240
  237. data/dist/es/ember-glimmer/tests/integration/helpers/concat-test.js +0 -106
  238. data/dist/es/ember-glimmer/tests/integration/helpers/custom-helper-test.js +0 -672
  239. data/dist/es/ember-glimmer/tests/integration/helpers/element-action-test.js +0 -1595
  240. data/dist/es/ember-glimmer/tests/integration/helpers/get-test.js +0 -618
  241. data/dist/es/ember-glimmer/tests/integration/helpers/hash-test.js +0 -188
  242. data/dist/es/ember-glimmer/tests/integration/helpers/if-unless-test.js +0 -149
  243. data/dist/es/ember-glimmer/tests/integration/helpers/input-test.js +0 -827
  244. data/dist/es/ember-glimmer/tests/integration/helpers/loc-test.js +0 -103
  245. data/dist/es/ember-glimmer/tests/integration/helpers/log-test.js +0 -61
  246. data/dist/es/ember-glimmer/tests/integration/helpers/mut-test.js +0 -580
  247. data/dist/es/ember-glimmer/tests/integration/helpers/partial-test.js +0 -386
  248. data/dist/es/ember-glimmer/tests/integration/helpers/readonly-test.js +0 -293
  249. data/dist/es/ember-glimmer/tests/integration/helpers/render-test.js +0 -522
  250. data/dist/es/ember-glimmer/tests/integration/helpers/text-area-test.js +0 -166
  251. data/dist/es/ember-glimmer/tests/integration/helpers/unbound-test.js +0 -650
  252. data/dist/es/ember-glimmer/tests/integration/helpers/yield-test.js +0 -275
  253. data/dist/es/ember-glimmer/tests/integration/input-test.js +0 -242
  254. data/dist/es/ember-glimmer/tests/integration/mount-test.js +0 -424
  255. data/dist/es/ember-glimmer/tests/integration/outlet-test.js +0 -318
  256. data/dist/es/ember-glimmer/tests/integration/refinements-test.js +0 -74
  257. data/dist/es/ember-glimmer/tests/integration/render-settled-test.js +0 -72
  258. data/dist/es/ember-glimmer/tests/integration/svg-test.js +0 -158
  259. data/dist/es/ember-glimmer/tests/integration/syntax/each-in-test.js +0 -697
  260. data/dist/es/ember-glimmer/tests/integration/syntax/each-test.js +0 -1251
  261. data/dist/es/ember-glimmer/tests/integration/syntax/experimental-syntax-test.js +0 -42
  262. data/dist/es/ember-glimmer/tests/integration/syntax/if-unless-test.js +0 -108
  263. data/dist/es/ember-glimmer/tests/integration/syntax/in-element-test.js +0 -119
  264. data/dist/es/ember-glimmer/tests/integration/syntax/let-test.js +0 -390
  265. data/dist/es/ember-glimmer/tests/integration/syntax/with-dynamic-var-test.js +0 -36
  266. data/dist/es/ember-glimmer/tests/integration/syntax/with-test.js +0 -422
  267. data/dist/es/ember-glimmer/tests/unit/outlet-test.js +0 -48
  268. data/dist/es/ember-glimmer/tests/unit/runtime-resolver-cache-test.js +0 -263
  269. data/dist/es/ember-glimmer/tests/unit/template-factory-test.js +0 -67
  270. data/dist/es/ember-glimmer/tests/unit/utils/debug-stack-test.js +0 -38
  271. data/dist/es/ember-glimmer/tests/utils/abstract-test-case.js +0 -1
  272. data/dist/es/ember-glimmer/tests/utils/helpers.js +0 -15
  273. data/dist/es/ember-glimmer/tests/utils/shared-conditional-tests.js +0 -965
  274. data/dist/es/ember-glimmer/tests/utils/string-test.js +0 -47
  275. data/dist/es/ember-glimmer/tests/utils/test-case.js +0 -6
  276. data/dist/es/ember-glimmer/tests/utils/test-helpers.js +0 -1
  277. data/dist/es/ember-meta/index.js +0 -1
  278. data/dist/es/ember-meta/lib/meta.js +0 -623
  279. data/dist/es/ember-meta/tests/meta_test.js +0 -169
  280. data/dist/es/ember-metal/index.js +0 -33
  281. data/dist/es/ember-metal/lib/alias.js +0 -80
  282. data/dist/es/ember-metal/lib/array.js +0 -55
  283. data/dist/es/ember-metal/lib/array_events.js +0 -65
  284. data/dist/es/ember-metal/lib/chains.js +0 -315
  285. data/dist/es/ember-metal/lib/change_event.js +0 -4
  286. data/dist/es/ember-metal/lib/computed.js +0 -526
  287. data/dist/es/ember-metal/lib/computed_cache.js +0 -58
  288. data/dist/es/ember-metal/lib/dependent_keys.js +0 -34
  289. data/dist/es/ember-metal/lib/deprecate_property.js +0 -34
  290. data/dist/es/ember-metal/lib/descriptor.js +0 -28
  291. data/dist/es/ember-metal/lib/each_proxy.js +0 -106
  292. data/dist/es/ember-metal/lib/each_proxy_events.js +0 -13
  293. data/dist/es/ember-metal/lib/events.js +0 -174
  294. data/dist/es/ember-metal/lib/expand_properties.js +0 -64
  295. data/dist/es/ember-metal/lib/get_properties.js +0 -45
  296. data/dist/es/ember-metal/lib/injected_property.js +0 -53
  297. data/dist/es/ember-metal/lib/is_blank.js +0 -34
  298. data/dist/es/ember-metal/lib/is_empty.js +0 -63
  299. data/dist/es/ember-metal/lib/is_none.js +0 -27
  300. data/dist/es/ember-metal/lib/is_present.js +0 -38
  301. data/dist/es/ember-metal/lib/libraries.js +0 -80
  302. data/dist/es/ember-metal/lib/mixin.js +0 -646
  303. data/dist/es/ember-metal/lib/namespace_search.js +0 -166
  304. data/dist/es/ember-metal/lib/observer.js +0 -34
  305. data/dist/es/ember-metal/lib/observer_set.js +0 -48
  306. data/dist/es/ember-metal/lib/path_cache.js +0 -5
  307. data/dist/es/ember-metal/lib/properties.js +0 -192
  308. data/dist/es/ember-metal/lib/property_events.js +0 -198
  309. data/dist/es/ember-metal/lib/property_get.js +0 -160
  310. data/dist/es/ember-metal/lib/property_set.js +0 -157
  311. data/dist/es/ember-metal/lib/set_properties.js +0 -43
  312. data/dist/es/ember-metal/lib/tags.js +0 -81
  313. data/dist/es/ember-metal/lib/tracked.js +0 -201
  314. data/dist/es/ember-metal/lib/transaction.js +0 -137
  315. data/dist/es/ember-metal/lib/watch_key.js +0 -113
  316. data/dist/es/ember-metal/lib/watch_path.js +0 -24
  317. data/dist/es/ember-metal/lib/watching.js +0 -54
  318. data/dist/es/ember-metal/tests/accessors/get_path_test.js +0 -82
  319. data/dist/es/ember-metal/tests/accessors/get_properties_test.js +0 -36
  320. data/dist/es/ember-metal/tests/accessors/get_test.js +0 -335
  321. data/dist/es/ember-metal/tests/accessors/mandatory_setters_test.js +0 -470
  322. data/dist/es/ember-metal/tests/accessors/set_path_test.js +0 -97
  323. data/dist/es/ember-metal/tests/accessors/set_test.js +0 -128
  324. data/dist/es/ember-metal/tests/alias_test.js +0 -167
  325. data/dist/es/ember-metal/tests/chains_test.js +0 -210
  326. data/dist/es/ember-metal/tests/computed_test.js +0 -1040
  327. data/dist/es/ember-metal/tests/descriptor_test.js +0 -368
  328. data/dist/es/ember-metal/tests/events_test.js +0 -210
  329. data/dist/es/ember-metal/tests/expand_properties_test.js +0 -119
  330. data/dist/es/ember-metal/tests/injected_property_test.js +0 -76
  331. data/dist/es/ember-metal/tests/is_blank_test.js +0 -29
  332. data/dist/es/ember-metal/tests/is_empty_test.js +0 -55
  333. data/dist/es/ember-metal/tests/is_none_test.js +0 -23
  334. data/dist/es/ember-metal/tests/is_present_test.js +0 -30
  335. data/dist/es/ember-metal/tests/libraries_test.js +0 -99
  336. data/dist/es/ember-metal/tests/main_test.js +0 -31
  337. data/dist/es/ember-metal/tests/mixin/alias_method_test.js +0 -91
  338. data/dist/es/ember-metal/tests/mixin/apply_test.js +0 -40
  339. data/dist/es/ember-metal/tests/mixin/computed_test.js +0 -166
  340. data/dist/es/ember-metal/tests/mixin/concatenated_properties_test.js +0 -117
  341. data/dist/es/ember-metal/tests/mixin/detect_test.js +0 -40
  342. data/dist/es/ember-metal/tests/mixin/introspection_test.js +0 -75
  343. data/dist/es/ember-metal/tests/mixin/merged_properties_test.js +0 -200
  344. data/dist/es/ember-metal/tests/mixin/method_test.js +0 -252
  345. data/dist/es/ember-metal/tests/mixin/observer_test.js +0 -202
  346. data/dist/es/ember-metal/tests/mixin/reopen_test.js +0 -53
  347. data/dist/es/ember-metal/tests/mixin/without_test.js +0 -22
  348. data/dist/es/ember-metal/tests/namespace_search_test.js +0 -16
  349. data/dist/es/ember-metal/tests/observer_test.js +0 -961
  350. data/dist/es/ember-metal/tests/performance_test.js +0 -81
  351. data/dist/es/ember-metal/tests/properties_test.js +0 -120
  352. data/dist/es/ember-metal/tests/property_did_change_hook.js +0 -73
  353. data/dist/es/ember-metal/tests/set_properties_test.js +0 -49
  354. data/dist/es/ember-metal/tests/tracked/computed_test.js +0 -67
  355. data/dist/es/ember-metal/tests/tracked/get_test.js +0 -86
  356. data/dist/es/ember-metal/tests/tracked/set_test.js +0 -44
  357. data/dist/es/ember-metal/tests/tracked/support.js +0 -37
  358. data/dist/es/ember-metal/tests/tracked/validation_test.js +0 -233
  359. data/dist/es/ember-metal/tests/watching/is_watching_test.js +0 -97
  360. data/dist/es/ember-metal/tests/watching/unwatch_test.js +0 -109
  361. data/dist/es/ember-metal/tests/watching/watch_test.js +0 -255
  362. data/dist/es/ember-owner/index.js +0 -66
  363. data/dist/es/ember-routing/index.js +0 -21
  364. data/dist/es/ember-routing/lib/ext/controller.js +0 -222
  365. data/dist/es/ember-routing/lib/location/api.js +0 -118
  366. data/dist/es/ember-routing/lib/location/auto_location.js +0 -323
  367. data/dist/es/ember-routing/lib/location/hash_location.js +0 -171
  368. data/dist/es/ember-routing/lib/location/history_location.js +0 -298
  369. data/dist/es/ember-routing/lib/location/none_location.js +0 -122
  370. data/dist/es/ember-routing/lib/location/util.js +0 -114
  371. data/dist/es/ember-routing/lib/services/router.js +0 -243
  372. data/dist/es/ember-routing/lib/services/routing.js +0 -101
  373. data/dist/es/ember-routing/lib/system/cache.js +0 -40
  374. data/dist/es/ember-routing/lib/system/controller_for.js +0 -14
  375. data/dist/es/ember-routing/lib/system/dsl.js +0 -208
  376. data/dist/es/ember-routing/lib/system/generate_controller.js +0 -54
  377. data/dist/es/ember-routing/lib/system/query_params.js +0 -6
  378. data/dist/es/ember-routing/lib/system/route.js +0 -2476
  379. data/dist/es/ember-routing/lib/system/router.js +0 -1607
  380. data/dist/es/ember-routing/lib/system/router_state.js +0 -26
  381. data/dist/es/ember-routing/lib/system/transition.js +0 -153
  382. data/dist/es/ember-routing/lib/utils.js +0 -230
  383. data/dist/es/ember-routing/tests/ext/controller_test.js +0 -85
  384. data/dist/es/ember-routing/tests/location/auto_location_test.js +0 -379
  385. data/dist/es/ember-routing/tests/location/hash_location_test.js +0 -207
  386. data/dist/es/ember-routing/tests/location/history_location_test.js +0 -322
  387. data/dist/es/ember-routing/tests/location/none_location_test.js +0 -88
  388. data/dist/es/ember-routing/tests/location/util_test.js +0 -159
  389. data/dist/es/ember-routing/tests/system/cache_test.js +0 -54
  390. data/dist/es/ember-routing/tests/system/controller_for_test.js +0 -75
  391. data/dist/es/ember-routing/tests/system/dsl_test.js +0 -413
  392. data/dist/es/ember-routing/tests/system/route_test.js +0 -587
  393. data/dist/es/ember-routing/tests/system/router_test.js +0 -287
  394. data/dist/es/ember-routing/tests/utils_test.js +0 -37
  395. data/dist/es/ember-runtime/.gitignore +0 -1
  396. data/dist/es/ember-runtime/README +0 -12
  397. data/dist/es/ember-runtime/index.js +0 -35
  398. data/dist/es/ember-runtime/lib/compare.js +0 -149
  399. data/dist/es/ember-runtime/lib/copy.js +0 -106
  400. data/dist/es/ember-runtime/lib/ext/function.js +0 -154
  401. data/dist/es/ember-runtime/lib/ext/rsvp.js +0 -59
  402. data/dist/es/ember-runtime/lib/is-equal.js +0 -60
  403. data/dist/es/ember-runtime/lib/mixins/-proxy.js +0 -109
  404. data/dist/es/ember-runtime/lib/mixins/action_handler.js +0 -222
  405. data/dist/es/ember-runtime/lib/mixins/array.js +0 -1661
  406. data/dist/es/ember-runtime/lib/mixins/comparable.js +0 -38
  407. data/dist/es/ember-runtime/lib/mixins/container_proxy.js +0 -154
  408. data/dist/es/ember-runtime/lib/mixins/copyable.js +0 -34
  409. data/dist/es/ember-runtime/lib/mixins/enumerable.js +0 -16
  410. data/dist/es/ember-runtime/lib/mixins/evented.js +0 -149
  411. data/dist/es/ember-runtime/lib/mixins/mutable_enumerable.js +0 -18
  412. data/dist/es/ember-runtime/lib/mixins/observable.js +0 -482
  413. data/dist/es/ember-runtime/lib/mixins/promise_proxy.js +0 -224
  414. data/dist/es/ember-runtime/lib/mixins/registry_proxy.js +0 -265
  415. data/dist/es/ember-runtime/lib/mixins/target_action_support.js +0 -172
  416. data/dist/es/ember-runtime/lib/system/array_proxy.js +0 -298
  417. data/dist/es/ember-runtime/lib/system/core_object.js +0 -1037
  418. data/dist/es/ember-runtime/lib/system/namespace.js +0 -69
  419. data/dist/es/ember-runtime/lib/system/object.js +0 -73
  420. data/dist/es/ember-runtime/lib/system/object_proxy.js +0 -81
  421. data/dist/es/ember-runtime/lib/type-of.js +0 -107
  422. data/dist/es/ember-runtime/tests/array/any-test.js +0 -55
  423. data/dist/es/ember-runtime/tests/array/compact-test.js +0 -12
  424. data/dist/es/ember-runtime/tests/array/every-test.js +0 -82
  425. data/dist/es/ember-runtime/tests/array/filter-test.js +0 -123
  426. data/dist/es/ember-runtime/tests/array/find-test.js +0 -86
  427. data/dist/es/ember-runtime/tests/array/firstObject-test.js +0 -27
  428. data/dist/es/ember-runtime/tests/array/forEach-test.js +0 -68
  429. data/dist/es/ember-runtime/tests/array/includes-test.js +0 -46
  430. data/dist/es/ember-runtime/tests/array/indexOf-test.js +0 -27
  431. data/dist/es/ember-runtime/tests/array/invoke-test.js +0 -60
  432. data/dist/es/ember-runtime/tests/array/isAny-test.js +0 -53
  433. data/dist/es/ember-runtime/tests/array/lastIndexOf-test.js +0 -78
  434. data/dist/es/ember-runtime/tests/array/lastObject-test.js +0 -31
  435. data/dist/es/ember-runtime/tests/array/map-test.js +0 -68
  436. data/dist/es/ember-runtime/tests/array/mapBy-test.js +0 -16
  437. data/dist/es/ember-runtime/tests/array/objectAt-test.js +0 -34
  438. data/dist/es/ember-runtime/tests/array/reduce-test.js +0 -24
  439. data/dist/es/ember-runtime/tests/array/reject-test.js +0 -134
  440. data/dist/es/ember-runtime/tests/array/sortBy-test.js +0 -23
  441. data/dist/es/ember-runtime/tests/array/toArray-test.js +0 -11
  442. data/dist/es/ember-runtime/tests/array/uniq-test.js +0 -27
  443. data/dist/es/ember-runtime/tests/array/uniqBy-test.js +0 -33
  444. data/dist/es/ember-runtime/tests/array/without-test.js +0 -39
  445. data/dist/es/ember-runtime/tests/copyable-array/copy-test.js +0 -12
  446. data/dist/es/ember-runtime/tests/core/compare_test.js +0 -89
  447. data/dist/es/ember-runtime/tests/core/copy_test.js +0 -47
  448. data/dist/es/ember-runtime/tests/core/isEqual_test.js +0 -65
  449. data/dist/es/ember-runtime/tests/core/is_array_test.js +0 -59
  450. data/dist/es/ember-runtime/tests/core/is_empty_test.js +0 -15
  451. data/dist/es/ember-runtime/tests/core/type_of_test.js +0 -54
  452. data/dist/es/ember-runtime/tests/ext/function_test.js +0 -121
  453. data/dist/es/ember-runtime/tests/ext/rsvp_test.js +0 -269
  454. data/dist/es/ember-runtime/tests/helpers/array.js +0 -336
  455. data/dist/es/ember-runtime/tests/inject_test.js +0 -51
  456. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/chained_test.js +0 -63
  457. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js +0 -892
  458. data/dist/es/ember-runtime/tests/legacy_1x/mixins/observable/propertyChanges_test.js +0 -142
  459. data/dist/es/ember-runtime/tests/legacy_1x/system/object/base_test.js +0 -98
  460. data/dist/es/ember-runtime/tests/legacy_1x/system/object/concatenated_test.js +0 -131
  461. data/dist/es/ember-runtime/tests/mixins/array_test.js +0 -400
  462. data/dist/es/ember-runtime/tests/mixins/comparable_test.js +0 -37
  463. data/dist/es/ember-runtime/tests/mixins/container_proxy_test.js +0 -48
  464. data/dist/es/ember-runtime/tests/mixins/enumerable_test.js +0 -17
  465. data/dist/es/ember-runtime/tests/mixins/evented_test.js +0 -23
  466. data/dist/es/ember-runtime/tests/mixins/mutable_enumerable_test.js +0 -17
  467. data/dist/es/ember-runtime/tests/mixins/observable_test.js +0 -137
  468. data/dist/es/ember-runtime/tests/mixins/promise_proxy_test.js +0 -593
  469. data/dist/es/ember-runtime/tests/mixins/target_action_support_test.js +0 -237
  470. data/dist/es/ember-runtime/tests/mutable-array/addObject-test.js +0 -76
  471. data/dist/es/ember-runtime/tests/mutable-array/clear-test.js +0 -64
  472. data/dist/es/ember-runtime/tests/mutable-array/insertAt-test.js +0 -216
  473. data/dist/es/ember-runtime/tests/mutable-array/popObject-test.js +0 -91
  474. data/dist/es/ember-runtime/tests/mutable-array/pushObject-test.js +0 -98
  475. data/dist/es/ember-runtime/tests/mutable-array/pushObjects-test.js +0 -12
  476. data/dist/es/ember-runtime/tests/mutable-array/removeAt-test.js +0 -187
  477. data/dist/es/ember-runtime/tests/mutable-array/removeObject-test.js +0 -77
  478. data/dist/es/ember-runtime/tests/mutable-array/removeObjects-test.js +0 -202
  479. data/dist/es/ember-runtime/tests/mutable-array/replace-test.js +0 -221
  480. data/dist/es/ember-runtime/tests/mutable-array/reverseObjects-test.js +0 -35
  481. data/dist/es/ember-runtime/tests/mutable-array/setObjects-test.js +0 -63
  482. data/dist/es/ember-runtime/tests/mutable-array/shiftObject-test.js +0 -105
  483. data/dist/es/ember-runtime/tests/mutable-array/unshiftObject-test.js +0 -99
  484. data/dist/es/ember-runtime/tests/mutable-array/unshiftObjects-test.js +0 -102
  485. data/dist/es/ember-runtime/tests/system/array_proxy/arranged_content_test.js +0 -275
  486. data/dist/es/ember-runtime/tests/system/array_proxy/array_observer_test.js +0 -51
  487. data/dist/es/ember-runtime/tests/system/array_proxy/content_change_test.js +0 -85
  488. data/dist/es/ember-runtime/tests/system/array_proxy/length_test.js +0 -201
  489. data/dist/es/ember-runtime/tests/system/array_proxy/watching_and_listening_test.js +0 -157
  490. data/dist/es/ember-runtime/tests/system/core_object_test.js +0 -114
  491. data/dist/es/ember-runtime/tests/system/namespace/base_test.js +0 -175
  492. data/dist/es/ember-runtime/tests/system/native_array/a_test.js +0 -16
  493. data/dist/es/ember-runtime/tests/system/native_array/copyable_suite_test.js +0 -19
  494. data/dist/es/ember-runtime/tests/system/native_array/replace_test.js +0 -17
  495. data/dist/es/ember-runtime/tests/system/object/computed_test.js +0 -352
  496. data/dist/es/ember-runtime/tests/system/object/create_test.js +0 -135
  497. data/dist/es/ember-runtime/tests/system/object/destroy_test.js +0 -146
  498. data/dist/es/ember-runtime/tests/system/object/detectInstance_test.js +0 -38
  499. data/dist/es/ember-runtime/tests/system/object/detect_test.js +0 -33
  500. data/dist/es/ember-runtime/tests/system/object/es-compatibility-test.js +0 -469
  501. data/dist/es/ember-runtime/tests/system/object/events_test.js +0 -156
  502. data/dist/es/ember-runtime/tests/system/object/extend_test.js +0 -153
  503. data/dist/es/ember-runtime/tests/system/object/observer_test.js +0 -216
  504. data/dist/es/ember-runtime/tests/system/object/reopenClass_test.js +0 -36
  505. data/dist/es/ember-runtime/tests/system/object/reopen_test.js +0 -48
  506. data/dist/es/ember-runtime/tests/system/object/strict-mode-test.js +0 -31
  507. data/dist/es/ember-runtime/tests/system/object/toString_test.js +0 -125
  508. data/dist/es/ember-runtime/tests/system/object_proxy_test.js +0 -314
  509. data/dist/es/ember-template-compiler/index.js +0 -26
  510. data/dist/es/ember-template-compiler/lib/compat.js +0 -16
  511. data/dist/es/ember-template-compiler/lib/plugins/assert-if-helper-without-arguments.js +0 -38
  512. data/dist/es/ember-template-compiler/lib/plugins/assert-input-helper-without-block.js +0 -20
  513. data/dist/es/ember-template-compiler/lib/plugins/assert-reserved-named-arguments.js +0 -26
  514. data/dist/es/ember-template-compiler/lib/plugins/assert-splattribute-expression.js +0 -27
  515. data/dist/es/ember-template-compiler/lib/plugins/deprecate-render-model.js +0 -38
  516. data/dist/es/ember-template-compiler/lib/plugins/deprecate-render.js +0 -41
  517. data/dist/es/ember-template-compiler/lib/plugins/deprecate-send-action.js +0 -42
  518. data/dist/es/ember-template-compiler/lib/plugins/index.js +0 -50
  519. data/dist/es/ember-template-compiler/lib/plugins/transform-action-syntax.js +0 -52
  520. data/dist/es/ember-template-compiler/lib/plugins/transform-angle-bracket-components.js +0 -10
  521. data/dist/es/ember-template-compiler/lib/plugins/transform-attrs-into-args.js +0 -62
  522. data/dist/es/ember-template-compiler/lib/plugins/transform-dot-component-invocation.js +0 -88
  523. data/dist/es/ember-template-compiler/lib/plugins/transform-each-in-into-each.js +0 -48
  524. data/dist/es/ember-template-compiler/lib/plugins/transform-has-block-syntax.js +0 -46
  525. data/dist/es/ember-template-compiler/lib/plugins/transform-in-element.js +0 -83
  526. data/dist/es/ember-template-compiler/lib/plugins/transform-inline-link-to.js +0 -31
  527. data/dist/es/ember-template-compiler/lib/plugins/transform-input-type-syntax.js +0 -52
  528. data/dist/es/ember-template-compiler/lib/plugins/transform-old-binding-syntax.js +0 -48
  529. data/dist/es/ember-template-compiler/lib/plugins/transform-old-class-binding-syntax.js +0 -102
  530. data/dist/es/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.js +0 -34
  531. data/dist/es/ember-template-compiler/lib/plugins/transform-top-level-components.js +0 -41
  532. data/dist/es/ember-template-compiler/lib/system/bootstrap.js +0 -44
  533. data/dist/es/ember-template-compiler/lib/system/calculate-location-display.js +0 -20
  534. data/dist/es/ember-template-compiler/lib/system/compile-options.js +0 -71
  535. data/dist/es/ember-template-compiler/lib/system/compile.js +0 -28
  536. data/dist/es/ember-template-compiler/lib/system/dasherize-component-name.js +0 -13
  537. data/dist/es/ember-template-compiler/lib/system/initializer.js +0 -22
  538. data/dist/es/ember-template-compiler/lib/system/precompile.js +0 -18
  539. data/dist/es/ember-template-compiler/tests/plugins/assert-if-helper-without-arguments-test.js +0 -51
  540. data/dist/es/ember-template-compiler/tests/plugins/assert-input-helper-without-block-test.js +0 -17
  541. data/dist/es/ember-template-compiler/tests/plugins/assert-reserved-named-arguments-test.js +0 -416
  542. data/dist/es/ember-template-compiler/tests/plugins/assert-splattribute-expression-test.js +0 -57
  543. data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-model-test.js +0 -19
  544. data/dist/es/ember-template-compiler/tests/plugins/deprecate-render-test.js +0 -19
  545. data/dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js +0 -29
  546. data/dist/es/ember-template-compiler/tests/plugins/transform-dot-component-invocation-test.js +0 -27
  547. data/dist/es/ember-template-compiler/tests/plugins/transform-inline-link-to-test.js +0 -15
  548. data/dist/es/ember-template-compiler/tests/plugins/transform-input-type-syntax-test.js +0 -25
  549. data/dist/es/ember-template-compiler/tests/system/bootstrap-test.js +0 -155
  550. data/dist/es/ember-template-compiler/tests/system/compile_options_test.js +0 -115
  551. data/dist/es/ember-template-compiler/tests/system/dasherize-component-name-test.js +0 -19
  552. data/dist/es/ember-testing/index.js +0 -10
  553. data/dist/es/ember-testing/lib/adapters/adapter.js +0 -58
  554. data/dist/es/ember-testing/lib/adapters/qunit.js +0 -47
  555. data/dist/es/ember-testing/lib/events.js +0 -136
  556. data/dist/es/ember-testing/lib/ext/application.js +0 -191
  557. data/dist/es/ember-testing/lib/ext/rsvp.js +0 -19
  558. data/dist/es/ember-testing/lib/helpers.js +0 -30
  559. data/dist/es/ember-testing/lib/helpers/-is-form-control.js +0 -16
  560. data/dist/es/ember-testing/lib/helpers/and_then.js +0 -3
  561. data/dist/es/ember-testing/lib/helpers/click.js +0 -36
  562. data/dist/es/ember-testing/lib/helpers/current_path.js +0 -27
  563. data/dist/es/ember-testing/lib/helpers/current_route_name.js +0 -25
  564. data/dist/es/ember-testing/lib/helpers/current_url.js +0 -27
  565. data/dist/es/ember-testing/lib/helpers/fill_in.js +0 -46
  566. data/dist/es/ember-testing/lib/helpers/find.js +0 -41
  567. data/dist/es/ember-testing/lib/helpers/find_with_assert.js +0 -34
  568. data/dist/es/ember-testing/lib/helpers/key_event.js +0 -36
  569. data/dist/es/ember-testing/lib/helpers/pause_test.js +0 -65
  570. data/dist/es/ember-testing/lib/helpers/trigger_event.js +0 -62
  571. data/dist/es/ember-testing/lib/helpers/visit.js +0 -42
  572. data/dist/es/ember-testing/lib/helpers/wait.js +0 -72
  573. data/dist/es/ember-testing/lib/initializers.js +0 -17
  574. data/dist/es/ember-testing/lib/setup_for_testing.js +0 -44
  575. data/dist/es/ember-testing/lib/support.js +0 -62
  576. data/dist/es/ember-testing/lib/test.js +0 -70
  577. data/dist/es/ember-testing/lib/test/adapter.js +0 -33
  578. data/dist/es/ember-testing/lib/test/helpers.js +0 -125
  579. data/dist/es/ember-testing/lib/test/on_inject_helpers.js +0 -38
  580. data/dist/es/ember-testing/lib/test/pending_requests.js +0 -24
  581. data/dist/es/ember-testing/lib/test/promise.js +0 -79
  582. data/dist/es/ember-testing/lib/test/run.js +0 -9
  583. data/dist/es/ember-testing/lib/test/waiters.js +0 -117
  584. data/dist/es/ember-testing/tests/acceptance_test.js +0 -478
  585. data/dist/es/ember-testing/tests/adapters/adapter_test.js +0 -31
  586. data/dist/es/ember-testing/tests/adapters/qunit_test.js +0 -50
  587. data/dist/es/ember-testing/tests/adapters_test.js +0 -405
  588. data/dist/es/ember-testing/tests/ext/rsvp_test.js +0 -124
  589. data/dist/es/ember-testing/tests/helper_registration_test.js +0 -98
  590. data/dist/es/ember-testing/tests/helpers_test.js +0 -1228
  591. data/dist/es/ember-testing/tests/integration_test.js +0 -106
  592. data/dist/es/ember-testing/tests/reexports_test.js +0 -26
  593. data/dist/es/ember-testing/tests/test/waiters-test.js +0 -145
  594. data/dist/es/ember-utils/index.js +0 -28
  595. data/dist/es/ember-utils/lib/cache.js +0 -36
  596. data/dist/es/ember-utils/lib/dictionary.js +0 -11
  597. data/dist/es/ember-utils/lib/guid.js +0 -120
  598. data/dist/es/ember-utils/lib/inspect.js +0 -112
  599. data/dist/es/ember-utils/lib/intern.js +0 -49
  600. data/dist/es/ember-utils/lib/invoke.js +0 -53
  601. data/dist/es/ember-utils/lib/is_proxy.js +0 -14
  602. data/dist/es/ember-utils/lib/lookup-descriptor.js +0 -11
  603. data/dist/es/ember-utils/lib/make-array.js +0 -7
  604. data/dist/es/ember-utils/lib/name.js +0 -9
  605. data/dist/es/ember-utils/lib/proxy-utils.js +0 -1
  606. data/dist/es/ember-utils/lib/spec.js +0 -14
  607. data/dist/es/ember-utils/lib/super.js +0 -83
  608. data/dist/es/ember-utils/lib/symbol-utils.js +0 -8
  609. data/dist/es/ember-utils/lib/symbol.js +0 -15
  610. data/dist/es/ember-utils/lib/to-string.js +0 -35
  611. data/dist/es/ember-utils/lib/weak_set.js +0 -18
  612. data/dist/es/ember-utils/tests/cache_test.js +0 -77
  613. data/dist/es/ember-utils/tests/can_invoke_test.js +0 -46
  614. data/dist/es/ember-utils/tests/checkHasSuper_test.js +0 -17
  615. data/dist/es/ember-utils/tests/generate_guid_test.js +0 -13
  616. data/dist/es/ember-utils/tests/guid_for_test.js +0 -101
  617. data/dist/es/ember-utils/tests/inspect_test.js +0 -146
  618. data/dist/es/ember-utils/tests/is_proxy_test.js +0 -18
  619. data/dist/es/ember-utils/tests/make_array_test.js +0 -41
  620. data/dist/es/ember-utils/tests/to-string-test.js +0 -32
  621. data/dist/es/ember-utils/tests/try_invoke_test.js +0 -48
  622. data/dist/es/ember-views/index.js +0 -28
  623. data/dist/es/ember-views/lib/compat/attrs.js +0 -3
  624. data/dist/es/ember-views/lib/compat/fallback-view-registry.js +0 -3
  625. data/dist/es/ember-views/lib/component_lookup.js +0 -27
  626. data/dist/es/ember-views/lib/mixins/action_support.js +0 -189
  627. data/dist/es/ember-views/lib/mixins/child_views_support.js +0 -27
  628. data/dist/es/ember-views/lib/mixins/class_names_support.js +0 -102
  629. data/dist/es/ember-views/lib/mixins/text_support.js +0 -333
  630. data/dist/es/ember-views/lib/mixins/view_state_support.js +0 -19
  631. data/dist/es/ember-views/lib/mixins/view_support.js +0 -452
  632. data/dist/es/ember-views/lib/system/action_manager.js +0 -14
  633. data/dist/es/ember-views/lib/system/event_dispatcher.js +0 -454
  634. data/dist/es/ember-views/lib/system/jquery.js +0 -29
  635. data/dist/es/ember-views/lib/system/jquery_event_deprecation.js +0 -61
  636. data/dist/es/ember-views/lib/system/lookup_partial.js +0 -55
  637. data/dist/es/ember-views/lib/system/utils.js +0 -201
  638. data/dist/es/ember-views/lib/utils/lookup-component.js +0 -58
  639. data/dist/es/ember-views/lib/views/core_view.js +0 -83
  640. data/dist/es/ember-views/lib/views/states.js +0 -48
  641. data/dist/es/ember-views/lib/views/states/default.js +0 -17
  642. data/dist/es/ember-views/lib/views/states/destroying.js +0 -16
  643. data/dist/es/ember-views/lib/views/states/has_element.js +0 -31
  644. data/dist/es/ember-views/lib/views/states/in_dom.js +0 -28
  645. data/dist/es/ember-views/lib/views/states/pre_render.js +0 -3
  646. data/dist/es/ember/index.js +0 -645
  647. data/dist/es/ember/tests/application_lifecycle_test.js +0 -188
  648. data/dist/es/ember/tests/component_context_test.js +0 -255
  649. data/dist/es/ember/tests/component_registration_test.js +0 -252
  650. data/dist/es/ember/tests/controller_test.js +0 -44
  651. data/dist/es/ember/tests/error_handler_test.js +0 -581
  652. data/dist/es/ember/tests/helpers/helper_registration_test.js +0 -103
  653. data/dist/es/ember/tests/helpers/link_to_test.js +0 -2103
  654. data/dist/es/ember/tests/helpers/link_to_test/link_to_transitioning_classes_test.js +0 -342
  655. data/dist/es/ember/tests/helpers/link_to_test/link_to_with_query_params_test.js +0 -694
  656. data/dist/es/ember/tests/homepage_example_test.js +0 -47
  657. data/dist/es/ember/tests/integration/multiple-app-test.js +0 -101
  658. data/dist/es/ember/tests/production_build_test.js +0 -34
  659. data/dist/es/ember/tests/reexports_test.js +0 -307
  660. data/dist/es/ember/tests/routing/decoupled_basic_test.js +0 -4506
  661. data/dist/es/ember/tests/routing/query_params_test.js +0 -1579
  662. data/dist/es/ember/tests/routing/query_params_test/model_dependent_state_with_query_params_test.js +0 -1117
  663. data/dist/es/ember/tests/routing/query_params_test/overlapping_query_params_test.js +0 -185
  664. data/dist/es/ember/tests/routing/query_params_test/query_param_async_get_handler_test.js +0 -327
  665. data/dist/es/ember/tests/routing/query_params_test/query_params_paramless_link_to_test.js +0 -37
  666. data/dist/es/ember/tests/routing/query_params_test/shared_state_test.js +0 -84
  667. data/dist/es/ember/tests/routing/router_map_test.js +0 -46
  668. data/dist/es/ember/tests/routing/router_service_test/basic_test.js +0 -95
  669. data/dist/es/ember/tests/routing/router_service_test/currenturl_lifecycle_test.js +0 -149
  670. data/dist/es/ember/tests/routing/router_service_test/isActive_test.js +0 -113
  671. data/dist/es/ember/tests/routing/router_service_test/replaceWith_test.js +0 -144
  672. data/dist/es/ember/tests/routing/router_service_test/transitionTo_test.js +0 -370
  673. data/dist/es/ember/tests/routing/router_service_test/urlFor_test.js +0 -307
  674. data/dist/es/ember/tests/routing/substates_test.js +0 -1110
  675. data/dist/es/ember/tests/routing/toplevel_dom_test.js +0 -37
  676. data/dist/es/ember/tests/service_injection_test.js +0 -278
  677. data/dist/es/ember/tests/view_instrumentation_test.js +0 -47
  678. data/dist/es/ember/version.js +0 -1
  679. data/dist/es/handlebars.js +0 -1268
  680. data/dist/es/internal-test-helpers/index.js +0 -31
  681. data/dist/es/internal-test-helpers/lib/.gitkeep +0 -0
  682. data/dist/es/internal-test-helpers/lib/apply-mixins.js +0 -37
  683. data/dist/es/internal-test-helpers/lib/browser-detect.js +0 -4
  684. data/dist/es/internal-test-helpers/lib/build-owner.js +0 -49
  685. data/dist/es/internal-test-helpers/lib/confirm-export.js +0 -45
  686. data/dist/es/internal-test-helpers/lib/ember-dev/assertion.js +0 -87
  687. data/dist/es/internal-test-helpers/lib/ember-dev/containers.js +0 -34
  688. data/dist/es/internal-test-helpers/lib/ember-dev/debug.js +0 -47
  689. data/dist/es/internal-test-helpers/lib/ember-dev/deprecation.js +0 -71
  690. data/dist/es/internal-test-helpers/lib/ember-dev/index.js +0 -19
  691. data/dist/es/internal-test-helpers/lib/ember-dev/method-call-tracker.js +0 -127
  692. data/dist/es/internal-test-helpers/lib/ember-dev/namespaces.js +0 -34
  693. data/dist/es/internal-test-helpers/lib/ember-dev/run-loop.js +0 -28
  694. data/dist/es/internal-test-helpers/lib/ember-dev/setup-qunit.js +0 -26
  695. data/dist/es/internal-test-helpers/lib/ember-dev/utils.js +0 -33
  696. data/dist/es/internal-test-helpers/lib/ember-dev/warning.js +0 -71
  697. data/dist/es/internal-test-helpers/lib/equal-inner-html.js +0 -37
  698. data/dist/es/internal-test-helpers/lib/equal-tokens.js +0 -53
  699. data/dist/es/internal-test-helpers/lib/factory.js +0 -65
  700. data/dist/es/internal-test-helpers/lib/get-all-property-names.js +0 -12
  701. data/dist/es/internal-test-helpers/lib/get-text-of.js +0 -3
  702. data/dist/es/internal-test-helpers/lib/matchers.js +0 -167
  703. data/dist/es/internal-test-helpers/lib/module-for.js +0 -89
  704. data/dist/es/internal-test-helpers/lib/registry-check.js +0 -28
  705. data/dist/es/internal-test-helpers/lib/run.js +0 -11
  706. data/dist/es/internal-test-helpers/lib/strip.js +0 -12
  707. data/dist/es/internal-test-helpers/lib/system/synthetic-events.js +0 -183
  708. data/dist/es/internal-test-helpers/lib/test-cases/abstract-application.js +0 -70
  709. data/dist/es/internal-test-helpers/lib/test-cases/abstract-rendering.js +0 -203
  710. data/dist/es/internal-test-helpers/lib/test-cases/abstract.js +0 -222
  711. data/dist/es/internal-test-helpers/lib/test-cases/application.js +0 -39
  712. data/dist/es/internal-test-helpers/lib/test-cases/autoboot-application.js +0 -34
  713. data/dist/es/internal-test-helpers/lib/test-cases/default-resolver-application.js +0 -43
  714. data/dist/es/internal-test-helpers/lib/test-cases/node-query.js +0 -120
  715. data/dist/es/internal-test-helpers/lib/test-cases/query-param.js +0 -124
  716. data/dist/es/internal-test-helpers/lib/test-cases/rendering.js +0 -14
  717. data/dist/es/internal-test-helpers/lib/test-cases/router.js +0 -26
  718. data/dist/es/internal-test-helpers/lib/test-cases/test-resolver-application.js +0 -40
  719. data/dist/es/internal-test-helpers/lib/test-resolver.js +0 -86
  720. data/dist/es/internal-test-helpers/tests/index-test.js +0 -10
  721. data/dist/es/route-recognizer.js +0 -685
  722. data/dist/es/router.js +0 -2454
  723. data/dist/es/rsvp.js +0 -2394
  724. data/dist/es/simple-html-tokenizer.js +0 -638
  725. data/dist/jquery/jquery.js +0 -10364
  726. data/dist/node/app-boot-test.js +0 -146
  727. data/dist/node/build-info-test.js +0 -177
  728. data/dist/node/component-rendering-test.js +0 -34
  729. data/dist/node/helpers/app-module.js +0 -198
  730. data/dist/node/helpers/assert-html-matches.js +0 -25
  731. data/dist/node/helpers/build-owner.js +0 -28
  732. data/dist/node/helpers/component-module.js +0 -137
  733. data/dist/node/sourcemap-test.js +0 -27
  734. data/dist/node/template-compiler-test.js +0 -45
  735. data/dist/node/visit-test.js +0 -349
  736. data/dist/qunit/qunit.css +0 -436
  737. data/dist/qunit/qunit.js +0 -5188
  738. data/dist/tests/index.html +0 -254
  739. data/ember-source.gemspec +0 -28
  740. data/node_modules/.yarn-integrity +0 -10
  741. data/yarn.lock +0 -4
@@ -1,39 +0,0 @@
1
- class InstructionEncoder {
2
- constructor(buffer) {
3
- this.buffer = buffer;
4
- this.typePos = 0;
5
- this.size = 0;
6
- }
7
- encode(type, machine) {
8
- if (type > 255 /* TYPE_SIZE */) {
9
- throw new Error(`Opcode type over 8-bits. Got ${type}.`);
10
- }
11
- this.buffer.push(type | machine | arguments.length - 2 << 8 /* ARG_SHIFT */);
12
- this.typePos = this.buffer.length - 1;
13
- for (let i = 2; i < arguments.length; i++) {
14
- let op = arguments[i];
15
- if (typeof op === 'number' && op > 65535 /* MAX_SIZE */) {
16
- throw new Error(`Operand over 16-bits. Got ${op}.`);
17
- }
18
- this.buffer.push(op);
19
- }
20
- this.size = this.buffer.length;
21
- }
22
- patch(position, target) {
23
- if (this.buffer[position + 1] === -1) {
24
- this.buffer[position + 1] = target;
25
- } else {
26
- throw new Error('Trying to patch operand in populated slot instead of a reserved slot.');
27
- }
28
- }
29
- patchWith(position, target, operand) {
30
- if (this.buffer[position + 1] === -1) {
31
- this.buffer[position + 1] = target;
32
- this.buffer[position + 2] = operand;
33
- } else {
34
- throw new Error('Trying to patch operand in populated slot instead of a reserved slot.');
35
- }
36
- }
37
- }
38
-
39
- export { InstructionEncoder };
@@ -1,82 +0,0 @@
1
- class Storage {
2
- constructor() {
3
- this.array = [];
4
- this.next = 0;
5
- }
6
- add(element) {
7
- let { next: slot, array } = this;
8
- if (slot === array.length) {
9
- this.next++;
10
- } else {
11
- let prev = array[slot];
12
- this.next = prev;
13
- }
14
- this.array[slot] = element;
15
- return slot;
16
- }
17
- deref(pointer) {
18
- return this.array[pointer];
19
- }
20
- drop(pointer) {
21
- this.array[pointer] = this.next;
22
- this.next = pointer;
23
- }
24
- }
25
-
26
- class Stack {
27
- constructor(vec = []) {
28
- this.vec = vec;
29
- }
30
- clone() {
31
- return new Stack(this.vec.slice());
32
- }
33
- sliceFrom(start) {
34
- return new Stack(this.vec.slice(start));
35
- }
36
- slice(start, end) {
37
- return new Stack(this.vec.slice(start, end));
38
- }
39
- copy(from, to) {
40
- this.vec[to] = this.vec[from];
41
- }
42
- // TODO: how to model u64 argument?
43
- writeRaw(pos, value) {
44
- // TODO: Grow?
45
- this.vec[pos] = value;
46
- }
47
- writeSmi(pos, value) {
48
- this.vec[pos] = encodeSmi(value);
49
- }
50
- // TODO: partially decoded enum?
51
- getRaw(pos) {
52
- return this.vec[pos];
53
- }
54
- getSmi(pos) {
55
- return decodeSmi(this.vec[pos]);
56
- }
57
- reset() {
58
- this.vec.length = 0;
59
- }
60
- len() {
61
- return this.vec.length;
62
- }
63
- }
64
- function decodeSmi(smi) {
65
- switch (smi & 0b111) {
66
- case 0 /* NUMBER */:
67
- return smi >> 3;
68
- case 4 /* NEGATIVE */:
69
- return -(smi >> 3);
70
- default:
71
- throw new Error('unreachable');
72
- }
73
- }
74
- function encodeSmi(primitive) {
75
- if (primitive < 0) {
76
- return Math.abs(primitive) << 3 | 4 /* NEGATIVE */;
77
- } else {
78
- return primitive << 3 | 0 /* NUMBER */;
79
- }
80
- }
81
-
82
- export { Storage, Stack };
@@ -1,112 +0,0 @@
1
- import { DOMTreeConstruction, ConcreteBounds, NewElementBuilder } from '@glimmer/runtime';
2
-
3
- class NodeDOMTreeConstruction extends DOMTreeConstruction {
4
- constructor(doc) {
5
- super(doc);
6
- }
7
- // override to prevent usage of `this.document` until after the constructor
8
- setupUselessElement() {}
9
- insertHTMLBefore(parent, reference, html) {
10
- let prev = reference ? reference.previousSibling : parent.lastChild;
11
- let raw = this.document.createRawHTMLSection(html);
12
- parent.insertBefore(raw, reference);
13
- let first = prev ? prev.nextSibling : parent.firstChild;
14
- let last = reference ? reference.previousSibling : parent.lastChild;
15
- return new ConcreteBounds(parent, first, last);
16
- }
17
- // override to avoid SVG detection/work when in node (this is not needed in SSR)
18
- createElement(tag) {
19
- return this.document.createElement(tag);
20
- }
21
- // override to avoid namespace shenanigans when in node (this is not needed in SSR)
22
- setAttribute(element, name, value) {
23
- element.setAttribute(name, value);
24
- }
25
- }
26
-
27
- const TEXT_NODE = 3;
28
- function currentNode(cursor) {
29
- let { element, nextSibling } = cursor;
30
- if (nextSibling === null) {
31
- return element.lastChild;
32
- } else {
33
- return nextSibling.previousSibling;
34
- }
35
- }
36
- class SerializeBuilder extends NewElementBuilder {
37
- constructor() {
38
- super(...arguments);
39
- this.serializeBlockDepth = 0;
40
- }
41
- __openBlock() {
42
- let depth = this.serializeBlockDepth++;
43
- this.__appendComment(`%+b:${depth}%`);
44
- super.__openBlock();
45
- }
46
- __closeBlock() {
47
- super.__closeBlock();
48
- this.__appendComment(`%-b:${--this.serializeBlockDepth}%`);
49
- }
50
- __appendHTML(html) {
51
- // Do we need to run the html tokenizer here?
52
- let first = this.__appendComment('%glmr%');
53
- if (this.element.tagName === 'TABLE') {
54
- let openIndex = html.indexOf('<');
55
- if (openIndex > -1) {
56
- let tr = html.slice(openIndex + 1, openIndex + 3);
57
- if (tr === 'tr') {
58
- html = `<tbody>${html}</tbody>`;
59
- }
60
- }
61
- }
62
- if (html === '') {
63
- this.__appendComment('% %');
64
- } else {
65
- super.__appendHTML(html);
66
- }
67
- let last = this.__appendComment('%glmr%');
68
- return new ConcreteBounds(this.element, first, last);
69
- }
70
- __appendText(string) {
71
- let current = currentNode(this);
72
- if (string === '') {
73
- return this.__appendComment('% %');
74
- } else if (current && current.nodeType === TEXT_NODE) {
75
- this.__appendComment('%|%');
76
- }
77
- return super.__appendText(string);
78
- }
79
- closeElement() {
80
- if (this.element['needsExtraClose'] === true) {
81
- this.element['needsExtraClose'] = false;
82
- super.closeElement();
83
- }
84
- super.closeElement();
85
- }
86
- openElement(tag) {
87
- if (tag === 'tr') {
88
- if (this.element.tagName !== 'TBODY') {
89
- this.openElement('tbody');
90
- // This prevents the closeBlock comment from being re-parented
91
- // under the auto inserted tbody. Rehydration builder needs to
92
- // account for the insertion since it is injected here and not
93
- // really in the template.
94
- this.constructing['needsExtraClose'] = true;
95
- this.flushElement();
96
- }
97
- }
98
- return super.openElement(tag);
99
- }
100
- pushRemoteElement(element, cursorId, nextSibling = null) {
101
- let { dom } = this;
102
- let script = dom.createElement('script');
103
- script.setAttribute('glmr', cursorId);
104
- dom.insertBefore(element, script, nextSibling);
105
- super.pushRemoteElement(element, cursorId, nextSibling);
106
- }
107
- }
108
- function serializeBuilder(env, cursor) {
109
- return SerializeBuilder.forInitialRender(env, cursor);
110
- }
111
-
112
- export { NodeDOMTreeConstruction, serializeBuilder };
@@ -1,1999 +0,0 @@
1
- import { dict, EMPTY_ARRAY, unreachable, Stack, assign } from '@glimmer/util';
2
- import { Register } from '@glimmer/vm';
3
- import { Ops } from '@glimmer/wire-format';
4
- import { InstructionEncoder } from '@glimmer/encoder';
5
- import { Program, LazyConstants } from '@glimmer/program';
6
-
7
- const PLACEHOLDER_HANDLE = -1;
8
-
9
- var Ops$1;
10
- (function (Ops$$1) {
11
- Ops$$1[Ops$$1["OpenComponentElement"] = 0] = "OpenComponentElement";
12
- Ops$$1[Ops$$1["DidCreateElement"] = 1] = "DidCreateElement";
13
- Ops$$1[Ops$$1["SetComponentAttrs"] = 2] = "SetComponentAttrs";
14
- Ops$$1[Ops$$1["DidRenderLayout"] = 3] = "DidRenderLayout";
15
- Ops$$1[Ops$$1["Debugger"] = 4] = "Debugger";
16
- })(Ops$1 || (Ops$1 = {}));
17
-
18
- var Ops$2 = Ops;
19
- const ATTRS_BLOCK = '&attrs';
20
- class Compilers {
21
- constructor(offset = 0) {
22
- this.offset = offset;
23
- this.names = dict();
24
- this.funcs = [];
25
- }
26
- add(name, func) {
27
- this.funcs.push(func);
28
- this.names[name] = this.funcs.length - 1;
29
- }
30
- compile(sexp, builder) {
31
- let name = sexp[this.offset];
32
- let index = this.names[name];
33
- let func = this.funcs[index];
34
-
35
- func(sexp, builder);
36
- }
37
- }
38
- let _statementCompiler;
39
- function statementCompiler() {
40
- if (_statementCompiler) {
41
- return _statementCompiler;
42
- }
43
- const STATEMENTS = _statementCompiler = new Compilers();
44
- STATEMENTS.add(Ops$2.Text, (sexp, builder) => {
45
- builder.text(sexp[1]);
46
- });
47
- STATEMENTS.add(Ops$2.Comment, (sexp, builder) => {
48
- builder.comment(sexp[1]);
49
- });
50
- STATEMENTS.add(Ops$2.CloseElement, (_sexp, builder) => {
51
- builder.closeElement();
52
- });
53
- STATEMENTS.add(Ops$2.FlushElement, (_sexp, builder) => {
54
- builder.flushElement();
55
- });
56
- STATEMENTS.add(Ops$2.Modifier, (sexp, builder) => {
57
- let { referrer } = builder;
58
- let [, name, params, hash] = sexp;
59
- let handle = builder.compiler.resolveModifier(name, referrer);
60
- if (handle !== null) {
61
- builder.modifier(handle, params, hash);
62
- } else {
63
- throw new Error(`Compile Error ${name} is not a modifier: Helpers may not be used in the element form.`);
64
- }
65
- });
66
- STATEMENTS.add(Ops$2.StaticAttr, (sexp, builder) => {
67
- let [, name, value, namespace] = sexp;
68
- builder.staticAttr(name, namespace, value);
69
- });
70
- STATEMENTS.add(Ops$2.DynamicAttr, (sexp, builder) => {
71
- dynamicAttr(sexp, false, builder);
72
- });
73
- STATEMENTS.add(Ops$2.TrustingAttr, (sexp, builder) => {
74
- dynamicAttr(sexp, true, builder);
75
- });
76
- STATEMENTS.add(Ops$2.OpenElement, (sexp, builder) => {
77
- builder.openPrimitiveElement(sexp[1]);
78
- });
79
- STATEMENTS.add(Ops$2.OpenSplattedElement, (sexp, builder) => {
80
- builder.setComponentAttrs(true);
81
- builder.putComponentOperations();
82
- builder.openPrimitiveElement(sexp[1]);
83
- });
84
- STATEMENTS.add(Ops$2.DynamicComponent, (sexp, builder) => {
85
- let [, definition, attrs, args, template] = sexp;
86
- let block = builder.template(template);
87
- let attrsBlock = null;
88
- if (attrs.length > 0) {
89
- let wrappedAttrs = [[Ops$2.ClientSideStatement, Ops$1.SetComponentAttrs, true], ...attrs, [Ops$2.ClientSideStatement, Ops$1.SetComponentAttrs, false]];
90
- attrsBlock = builder.inlineBlock({ statements: wrappedAttrs, parameters: EMPTY_ARRAY });
91
- }
92
- builder.dynamicComponent(definition, attrsBlock, null, args, false, block, null);
93
- });
94
- STATEMENTS.add(Ops$2.Component, (sexp, builder) => {
95
- let [, tag, _attrs, args, block] = sexp;
96
- let { referrer } = builder;
97
- let { handle, capabilities, compilable } = builder.compiler.resolveLayoutForTag(tag, referrer);
98
- if (handle !== null && capabilities !== null) {
99
- let attrs = [[Ops$2.ClientSideStatement, Ops$1.SetComponentAttrs, true], ..._attrs, [Ops$2.ClientSideStatement, Ops$1.SetComponentAttrs, false]];
100
- let attrsBlock = builder.inlineBlock({ statements: attrs, parameters: EMPTY_ARRAY });
101
- let child = builder.template(block);
102
- if (compilable) {
103
- builder.pushComponentDefinition(handle);
104
- builder.invokeStaticComponent(capabilities, compilable, attrsBlock, null, args, false, child && child);
105
- } else {
106
- builder.pushComponentDefinition(handle);
107
- builder.invokeComponent(capabilities, attrsBlock, null, args, false, child && child);
108
- }
109
- } else {
110
- throw new Error(`Compile Error: Cannot find component ${tag}`);
111
- }
112
- });
113
- STATEMENTS.add(Ops$2.Partial, (sexp, builder) => {
114
- let [, name, evalInfo] = sexp;
115
- let { referrer } = builder;
116
- builder.replayableIf({
117
- args() {
118
- builder.expr(name);
119
- builder.dup();
120
- return 2;
121
- },
122
- ifTrue() {
123
- builder.invokePartial(referrer, builder.evalSymbols(), evalInfo);
124
- builder.popScope();
125
- builder.popFrame(); // FIXME: WAT
126
- }
127
- });
128
- });
129
- STATEMENTS.add(Ops$2.Yield, (sexp, builder) => {
130
- let [, to, params] = sexp;
131
- builder.yield(to, params);
132
- });
133
- STATEMENTS.add(Ops$2.AttrSplat, (sexp, builder) => {
134
- let [, to] = sexp;
135
- builder.yield(to, []);
136
- builder.setComponentAttrs(false);
137
- });
138
- STATEMENTS.add(Ops$2.Debugger, (sexp, builder) => {
139
- let [, evalInfo] = sexp;
140
- builder.debugger(builder.evalSymbols(), evalInfo);
141
- });
142
- STATEMENTS.add(Ops$2.ClientSideStatement, (sexp, builder) => {
143
- CLIENT_SIDE.compile(sexp, builder);
144
- });
145
- STATEMENTS.add(Ops$2.Append, (sexp, builder) => {
146
- let [, value, trusting] = sexp;
147
- let returned = builder.compileInline(sexp) || value;
148
- if (returned === true) return;
149
- builder.guardedAppend(value, trusting);
150
- });
151
- STATEMENTS.add(Ops$2.Block, (sexp, builder) => {
152
- let [, name, params, hash, _template, _inverse] = sexp;
153
- let template = builder.template(_template);
154
- let inverse = builder.template(_inverse);
155
- let templateBlock = template && template;
156
- let inverseBlock = inverse && inverse;
157
- builder.compileBlock(name, params, hash, templateBlock, inverseBlock);
158
- });
159
- const CLIENT_SIDE = new Compilers(1);
160
- CLIENT_SIDE.add(Ops$1.OpenComponentElement, (sexp, builder) => {
161
- builder.putComponentOperations();
162
- builder.openPrimitiveElement(sexp[2]);
163
- });
164
- CLIENT_SIDE.add(Ops$1.DidCreateElement, (_sexp, builder) => {
165
- builder.didCreateElement(Register.s0);
166
- });
167
- CLIENT_SIDE.add(Ops$1.SetComponentAttrs, (sexp, builder) => {
168
- builder.setComponentAttrs(sexp[2]);
169
- });
170
- CLIENT_SIDE.add(Ops$1.Debugger, () => {
171
- // tslint:disable-next-line:no-debugger
172
- debugger;
173
- });
174
- CLIENT_SIDE.add(Ops$1.DidRenderLayout, (_sexp, builder) => {
175
- builder.didRenderLayout(Register.s0);
176
- });
177
- return STATEMENTS;
178
- }
179
- function dynamicAttr(sexp, trusting, builder) {
180
- let [, name, value, namespace] = sexp;
181
- builder.expr(value);
182
- if (namespace) {
183
- builder.dynamicAttr(name, namespace, trusting);
184
- } else {
185
- builder.dynamicAttr(name, null, trusting);
186
- }
187
- }
188
- let _expressionCompiler;
189
- function expressionCompiler() {
190
- if (_expressionCompiler) {
191
- return _expressionCompiler;
192
- }
193
- const EXPRESSIONS = _expressionCompiler = new Compilers();
194
- EXPRESSIONS.add(Ops$2.Unknown, (sexp, builder) => {
195
- let { compiler, referrer, containingLayout: { asPartial } } = builder;
196
- let name = sexp[1];
197
- let handle = compiler.resolveHelper(name, referrer);
198
- if (handle !== null) {
199
- builder.helper(handle, null, null);
200
- } else if (asPartial) {
201
- builder.resolveMaybeLocal(name);
202
- } else {
203
- builder.getVariable(0);
204
- builder.getProperty(name);
205
- }
206
- });
207
- EXPRESSIONS.add(Ops$2.Concat, (sexp, builder) => {
208
- let parts = sexp[1];
209
- for (let i = 0; i < parts.length; i++) {
210
- builder.expr(parts[i]);
211
- }
212
- builder.concat(parts.length);
213
- });
214
- EXPRESSIONS.add(Ops$2.Helper, (sexp, builder) => {
215
- let { compiler, referrer } = builder;
216
- let [, name, params, hash] = sexp;
217
- // TODO: triage this in the WF compiler
218
- if (name === 'component') {
219
-
220
- let [definition, ...restArgs] = params;
221
- builder.curryComponent(definition, restArgs, hash, true);
222
- return;
223
- }
224
- let handle = compiler.resolveHelper(name, referrer);
225
- if (handle !== null) {
226
- builder.helper(handle, params, hash);
227
- } else {
228
- throw new Error(`Compile Error: ${name} is not a helper`);
229
- }
230
- });
231
- EXPRESSIONS.add(Ops$2.Get, (sexp, builder) => {
232
- let [, head, path] = sexp;
233
- builder.getVariable(head);
234
- for (let i = 0; i < path.length; i++) {
235
- builder.getProperty(path[i]);
236
- }
237
- });
238
- EXPRESSIONS.add(Ops$2.MaybeLocal, (sexp, builder) => {
239
- let [, path] = sexp;
240
- if (builder.containingLayout.asPartial) {
241
- let head = path[0];
242
- path = path.slice(1);
243
- builder.resolveMaybeLocal(head);
244
- } else {
245
- builder.getVariable(0);
246
- }
247
- for (let i = 0; i < path.length; i++) {
248
- builder.getProperty(path[i]);
249
- }
250
- });
251
- EXPRESSIONS.add(Ops$2.Undefined, (_sexp, builder) => {
252
- return builder.pushPrimitiveReference(undefined);
253
- });
254
- EXPRESSIONS.add(Ops$2.HasBlock, (sexp, builder) => {
255
- builder.hasBlock(sexp[1]);
256
- });
257
- EXPRESSIONS.add(Ops$2.HasBlockParams, (sexp, builder) => {
258
- builder.hasBlockParams(sexp[1]);
259
- });
260
- return EXPRESSIONS;
261
- }
262
- class Macros {
263
- constructor() {
264
- let { blocks, inlines } = populateBuiltins();
265
- this.blocks = blocks;
266
- this.inlines = inlines;
267
- }
268
- }
269
- class Blocks {
270
- constructor() {
271
- this.names = dict();
272
- this.funcs = [];
273
- }
274
- add(name, func) {
275
- this.funcs.push(func);
276
- this.names[name] = this.funcs.length - 1;
277
- }
278
- addMissing(func) {
279
- this.missing = func;
280
- }
281
- compile(name, params, hash, template, inverse, builder) {
282
- let index = this.names[name];
283
- if (index === undefined) {
284
-
285
- let func = this.missing;
286
- let handled = func(name, params, hash, template, inverse, builder);
287
- } else {
288
- let func = this.funcs[index];
289
- func(params, hash, template, inverse, builder);
290
- }
291
- }
292
- }
293
- class Inlines {
294
- constructor() {
295
- this.names = dict();
296
- this.funcs = [];
297
- }
298
- add(name, func) {
299
- this.funcs.push(func);
300
- this.names[name] = this.funcs.length - 1;
301
- }
302
- addMissing(func) {
303
- this.missing = func;
304
- }
305
- compile(sexp, builder) {
306
- let value = sexp[1];
307
- // TODO: Fix this so that expression macros can return
308
- // things like components, so that {{component foo}}
309
- // is the same as {{(component foo)}}
310
- if (!Array.isArray(value)) return ['expr', value];
311
- let name;
312
- let params;
313
- let hash;
314
- if (value[0] === Ops$2.Helper) {
315
- name = value[1];
316
- params = value[2];
317
- hash = value[3];
318
- } else if (value[0] === Ops$2.Unknown) {
319
- name = value[1];
320
- params = hash = null;
321
- } else {
322
- return ['expr', value];
323
- }
324
- let index = this.names[name];
325
- if (index === undefined && this.missing) {
326
- let func = this.missing;
327
- let returned = func(name, params, hash, builder);
328
- return returned === false ? ['expr', value] : returned;
329
- } else if (index !== undefined) {
330
- let func = this.funcs[index];
331
- let returned = func(name, params, hash, builder);
332
- return returned === false ? ['expr', value] : returned;
333
- } else {
334
- return ['expr', value];
335
- }
336
- }
337
- }
338
- function populateBuiltins(blocks = new Blocks(), inlines = new Inlines()) {
339
- blocks.add('if', (params, _hash, template, inverse, builder) => {
340
- // PutArgs
341
- // Test(Environment)
342
- // Enter(BEGIN, END)
343
- // BEGIN: Noop
344
- // JumpUnless(ELSE)
345
- // Evaluate(default)
346
- // Jump(END)
347
- // ELSE: Noop
348
- // Evalulate(inverse)
349
- // END: Noop
350
- // Exit
351
- if (!params || params.length !== 1) {
352
- throw new Error(`SYNTAX ERROR: #if requires a single argument`);
353
- }
354
- builder.replayableIf({
355
- args() {
356
- builder.expr(params[0]);
357
- builder.toBoolean();
358
- return 1;
359
- },
360
- ifTrue() {
361
- builder.invokeStaticBlock(template);
362
- },
363
- ifFalse() {
364
- if (inverse) {
365
- builder.invokeStaticBlock(inverse);
366
- }
367
- }
368
- });
369
- });
370
- blocks.add('unless', (params, _hash, template, inverse, builder) => {
371
- // PutArgs
372
- // Test(Environment)
373
- // Enter(BEGIN, END)
374
- // BEGIN: Noop
375
- // JumpUnless(ELSE)
376
- // Evaluate(default)
377
- // Jump(END)
378
- // ELSE: Noop
379
- // Evalulate(inverse)
380
- // END: Noop
381
- // Exit
382
- if (!params || params.length !== 1) {
383
- throw new Error(`SYNTAX ERROR: #unless requires a single argument`);
384
- }
385
- builder.replayableIf({
386
- args() {
387
- builder.expr(params[0]);
388
- builder.toBoolean();
389
- return 1;
390
- },
391
- ifTrue() {
392
- if (inverse) {
393
- builder.invokeStaticBlock(inverse);
394
- }
395
- },
396
- ifFalse() {
397
- builder.invokeStaticBlock(template);
398
- }
399
- });
400
- });
401
- blocks.add('with', (params, _hash, template, inverse, builder) => {
402
- // PutArgs
403
- // Test(Environment)
404
- // Enter(BEGIN, END)
405
- // BEGIN: Noop
406
- // JumpUnless(ELSE)
407
- // Evaluate(default)
408
- // Jump(END)
409
- // ELSE: Noop
410
- // Evalulate(inverse)
411
- // END: Noop
412
- // Exit
413
- if (!params || params.length !== 1) {
414
- throw new Error(`SYNTAX ERROR: #with requires a single argument`);
415
- }
416
- builder.replayableIf({
417
- args() {
418
- builder.expr(params[0]);
419
- builder.dup();
420
- builder.toBoolean();
421
- return 2;
422
- },
423
- ifTrue() {
424
- builder.invokeStaticBlock(template, 1);
425
- },
426
- ifFalse() {
427
- if (inverse) {
428
- builder.invokeStaticBlock(inverse);
429
- }
430
- }
431
- });
432
- });
433
- blocks.add('each', (params, hash, template, inverse, builder) => {
434
- // Enter(BEGIN, END)
435
- // BEGIN: Noop
436
- // PutArgs
437
- // PutIterable
438
- // JumpUnless(ELSE)
439
- // EnterList(BEGIN2, END2)
440
- // ITER: Noop
441
- // NextIter(BREAK)
442
- // BEGIN2: Noop
443
- // PushChildScope
444
- // Evaluate(default)
445
- // PopScope
446
- // END2: Noop
447
- // Exit
448
- // Jump(ITER)
449
- // BREAK: Noop
450
- // ExitList
451
- // Jump(END)
452
- // ELSE: Noop
453
- // Evalulate(inverse)
454
- // END: Noop
455
- // Exit
456
- builder.replayable({
457
- args() {
458
- if (hash && hash[0][0] === 'key') {
459
- builder.expr(hash[1][0]);
460
- } else {
461
- builder.pushPrimitiveReference(null);
462
- }
463
- builder.expr(params[0]);
464
- return 2;
465
- },
466
- body() {
467
- builder.putIterator();
468
- builder.jumpUnless('ELSE');
469
- builder.pushFrame();
470
- builder.dup(Register.fp, 1);
471
- builder.returnTo('ITER');
472
- builder.enterList('BODY');
473
- builder.label('ITER');
474
- builder.iterate('BREAK');
475
- builder.label('BODY');
476
- builder.invokeStaticBlock(template, 2);
477
- builder.pop(2);
478
- builder.jump('FINALLY');
479
- builder.label('BREAK');
480
- builder.exitList();
481
- builder.popFrame();
482
- builder.jump('FINALLY');
483
- builder.label('ELSE');
484
- if (inverse) {
485
- builder.invokeStaticBlock(inverse);
486
- }
487
- }
488
- });
489
- });
490
- blocks.add('in-element', (params, hash, template, _inverse, builder) => {
491
- if (!params || params.length !== 1) {
492
- throw new Error(`SYNTAX ERROR: #in-element requires a single argument`);
493
- }
494
- builder.replayableIf({
495
- args() {
496
- let [keys, values] = hash;
497
- for (let i = 0; i < keys.length; i++) {
498
- let key = keys[i];
499
- if (key === 'nextSibling' || key === 'guid') {
500
- builder.expr(values[i]);
501
- } else {
502
- throw new Error(`SYNTAX ERROR: #in-element does not take a \`${keys[0]}\` option`);
503
- }
504
- }
505
- builder.expr(params[0]);
506
- builder.dup();
507
- return 4;
508
- },
509
- ifTrue() {
510
- builder.pushRemoteElement();
511
- builder.invokeStaticBlock(template);
512
- builder.popRemoteElement();
513
- }
514
- });
515
- });
516
- blocks.add('-with-dynamic-vars', (_params, hash, template, _inverse, builder) => {
517
- if (hash) {
518
- let [names, expressions] = hash;
519
- builder.compileParams(expressions);
520
- builder.pushDynamicScope();
521
- builder.bindDynamicScope(names);
522
- builder.invokeStaticBlock(template);
523
- builder.popDynamicScope();
524
- } else {
525
- builder.invokeStaticBlock(template);
526
- }
527
- });
528
- blocks.add('component', (_params, hash, template, inverse, builder) => {
529
-
530
- let tag = _params[0];
531
- if (typeof tag === 'string') {
532
- let returned = builder.staticComponentHelper(_params[0], hash, template);
533
- if (returned) return;
534
- }
535
- let [definition, ...params] = _params;
536
- builder.dynamicComponent(definition, null, params, hash, true, template, inverse);
537
- });
538
- inlines.add('component', (_name, _params, hash, builder) => {
539
-
540
- let tag = _params && _params[0];
541
- if (typeof tag === 'string') {
542
- let returned = builder.staticComponentHelper(tag, hash, null);
543
- if (returned) return true;
544
- }
545
- let [definition, ...params] = _params;
546
- builder.dynamicComponent(definition, null, params, hash, true, null, null);
547
- return true;
548
- });
549
- return { blocks, inlines };
550
- }
551
-
552
- const PLACEHOLDER_HANDLE$1 = -1;
553
- class CompilableProgram {
554
- constructor(compiler, layout) {
555
- this.compiler = compiler;
556
- this.layout = layout;
557
- this.compiled = null;
558
- }
559
- get symbolTable() {
560
- return this.layout.block;
561
- }
562
- compile() {
563
- if (this.compiled !== null) return this.compiled;
564
- this.compiled = PLACEHOLDER_HANDLE$1;
565
- let { block: { statements } } = this.layout;
566
- return this.compiled = this.compiler.add(statements, this.layout);
567
- }
568
- }
569
- class CompilableBlock {
570
- constructor(compiler, parsed) {
571
- this.compiler = compiler;
572
- this.parsed = parsed;
573
- this.compiled = null;
574
- }
575
- get symbolTable() {
576
- return this.parsed.block;
577
- }
578
- compile() {
579
- if (this.compiled !== null) return this.compiled;
580
- // Track that compilation has started but not yet finished by temporarily
581
- // using a placeholder handle. In eager compilation mode, where compile()
582
- // may be called recursively, we use this as a signal that the handle cannot
583
- // be known synchronously and must be linked lazily.
584
- this.compiled = PLACEHOLDER_HANDLE$1;
585
- let { block: { statements }, containingLayout } = this.parsed;
586
- return this.compiled = this.compiler.add(statements, containingLayout);
587
- }
588
- }
589
-
590
- function compile(statements, builder, compiler) {
591
- let sCompiler = statementCompiler();
592
- for (let i = 0; i < statements.length; i++) {
593
- sCompiler.compile(statements[i], builder);
594
- }
595
- let handle = builder.commit();
596
- return handle;
597
- }
598
-
599
- function debugSlice(program, start, end) {
600
- }
601
- function logOpcode(type, params) {
602
- let out = type;
603
- if (params) {
604
- let args = Object.keys(params).map(p => ` ${p}=${json(params[p])}`).join('');
605
- out += args;
606
- }
607
- return `(${out})`;
608
- }
609
- function json(param) {
610
- }
611
- function debug(pos, c, op, ...operands) {
612
- let metadata = null;
613
- if (!metadata) {
614
- throw unreachable(`Missing Opcode Metadata for ${op}`);
615
- }
616
- let out = dict();
617
- metadata.ops.forEach((operand, index) => {
618
- let op = operands[index];
619
- switch (operand.type) {
620
- case 'to':
621
- out[operand.name] = pos + op;
622
- break;
623
- case 'i32':
624
- case 'symbol':
625
- case 'block':
626
- out[operand.name] = op;
627
- break;
628
- case 'handle':
629
- out[operand.name] = c.resolveHandle(op);
630
- break;
631
- case 'str':
632
- out[operand.name] = c.getString(op);
633
- break;
634
- case 'option-str':
635
- out[operand.name] = op ? c.getString(op) : null;
636
- break;
637
- case 'str-array':
638
- out[operand.name] = c.getStringArray(op);
639
- break;
640
- case 'array':
641
- out[operand.name] = c.getArray(op);
642
- break;
643
- case 'bool':
644
- out[operand.name] = !!op;
645
- break;
646
- case 'primitive':
647
- out[operand.name] = decodePrimitive(op, c);
648
- break;
649
- case 'register':
650
- out[operand.name] = Register[op];
651
- break;
652
- case 'serializable':
653
- out[operand.name] = c.getSerializable(op);
654
- break;
655
- case 'lazy-constant':
656
- out[operand.name] = c.getOther(op);
657
- break;
658
- }
659
- });
660
- return [metadata.name, out];
661
- }
662
- function decodePrimitive(primitive, constants) {
663
- let flag = primitive & 7; // 111
664
- let value = primitive >> 3;
665
- switch (flag) {
666
- case 0 /* NUMBER */:
667
- return value;
668
- case 1 /* FLOAT */:
669
- return constants.getNumber(value);
670
- case 2 /* STRING */:
671
- return constants.getString(value);
672
- case 3 /* BOOLEAN_OR_VOID */:
673
- switch (value) {
674
- case 0:
675
- return false;
676
- case 1:
677
- return true;
678
- case 2:
679
- return null;
680
- case 3:
681
- return undefined;
682
- }
683
- case 4 /* NEGATIVE */:
684
- return constants.getNumber(value);
685
- default:
686
- throw unreachable();
687
- }
688
- }
689
-
690
- class StdLib {
691
- constructor(main, trustingGuardedAppend, cautiousGuardedAppend) {
692
- this.main = main;
693
- this.trustingGuardedAppend = trustingGuardedAppend;
694
- this.cautiousGuardedAppend = cautiousGuardedAppend;
695
- }
696
- static compile(compiler) {
697
- let main = this.std(compiler, b => b.main());
698
- let trustingGuardedAppend = this.std(compiler, b => b.stdAppend(true));
699
- let cautiousGuardedAppend = this.std(compiler, b => b.stdAppend(false));
700
- return new StdLib(main, trustingGuardedAppend, cautiousGuardedAppend);
701
- }
702
- static std(compiler, callback) {
703
- return StdOpcodeBuilder.build(compiler, callback);
704
- }
705
- getAppend(trusting) {
706
- return trusting ? this.trustingGuardedAppend : this.cautiousGuardedAppend;
707
- }
708
- }
709
- class AbstractCompiler {
710
- constructor(macros, program, resolver) {
711
- this.macros = macros;
712
- this.program = program;
713
- this.resolver = resolver;
714
- this.initialize();
715
- }
716
- initialize() {
717
- this.stdLib = StdLib.compile(this);
718
- }
719
- get constants() {
720
- return this.program.constants;
721
- }
722
- compileInline(sexp, builder) {
723
- let { inlines } = this.macros;
724
- return inlines.compile(sexp, builder);
725
- }
726
- compileBlock(name, params, hash, template, inverse, builder) {
727
- let { blocks } = this.macros;
728
- blocks.compile(name, params, hash, template, inverse, builder);
729
- }
730
- add(statements, containingLayout) {
731
- return compile(statements, this.builderFor(containingLayout), this);
732
- }
733
- commit(scopeSize, buffer) {
734
- let heap = this.program.heap;
735
- // TODO: change the whole malloc API and do something more efficient
736
- let handle = heap.malloc();
737
- for (let i = 0; i < buffer.length; i++) {
738
- let value = buffer[i];
739
- if (typeof value === 'function') {
740
- heap.pushPlaceholder(value);
741
- } else {
742
- heap.push(value);
743
- }
744
- }
745
- heap.finishMalloc(handle, scopeSize);
746
- return handle;
747
- }
748
- resolveLayoutForTag(tag, referrer) {
749
- let { resolver } = this;
750
- let handle = resolver.lookupComponentDefinition(tag, referrer);
751
- if (handle === null) return { handle: null, capabilities: null, compilable: null };
752
- return this.resolveLayoutForHandle(handle);
753
- }
754
- resolveLayoutForHandle(handle) {
755
- let { resolver } = this;
756
- let capabilities = resolver.getCapabilities(handle);
757
- let compilable = null;
758
- if (!capabilities.dynamicLayout) {
759
- compilable = resolver.getLayout(handle);
760
- }
761
- return {
762
- handle,
763
- capabilities,
764
- compilable
765
- };
766
- }
767
- resolveModifier(name, referrer) {
768
- return this.resolver.lookupModifier(name, referrer);
769
- }
770
- resolveHelper(name, referrer) {
771
- return this.resolver.lookupHelper(name, referrer);
772
- }
773
- }
774
- let debugCompiler;
775
-
776
- class WrappedBuilder {
777
- constructor(compiler, layout) {
778
- this.compiler = compiler;
779
- this.layout = layout;
780
- this.compiled = null;
781
- let { block } = layout;
782
- let symbols = block.symbols.slice();
783
- // ensure ATTRS_BLOCK is always included (only once) in the list of symbols
784
- let attrsBlockIndex = symbols.indexOf(ATTRS_BLOCK);
785
- if (attrsBlockIndex === -1) {
786
- this.attrsBlockNumber = symbols.push(ATTRS_BLOCK);
787
- } else {
788
- this.attrsBlockNumber = attrsBlockIndex + 1;
789
- }
790
- this.symbolTable = {
791
- hasEval: block.hasEval,
792
- symbols
793
- };
794
- }
795
- compile() {
796
- if (this.compiled !== null) return this.compiled;
797
- //========DYNAMIC
798
- // PutValue(TagExpr)
799
- // Test
800
- // JumpUnless(BODY)
801
- // PutComponentOperations
802
- // OpenDynamicPrimitiveElement
803
- // DidCreateElement
804
- // ...attr statements...
805
- // FlushElement
806
- // BODY: Noop
807
- // ...body statements...
808
- // PutValue(TagExpr)
809
- // Test
810
- // JumpUnless(END)
811
- // CloseElement
812
- // END: Noop
813
- // DidRenderLayout
814
- // Exit
815
- //
816
- //========STATIC
817
- // OpenPrimitiveElementOpcode
818
- // DidCreateElement
819
- // ...attr statements...
820
- // FlushElement
821
- // ...body statements...
822
- // CloseElement
823
- // DidRenderLayout
824
- // Exit
825
- let { compiler, layout } = this;
826
- let b = compiler.builderFor(layout);
827
- b.startLabels();
828
- b.fetch(Register.s1);
829
- b.getComponentTagName(Register.s0);
830
- b.primitiveReference();
831
- b.dup();
832
- b.load(Register.s1);
833
- b.jumpUnless('BODY');
834
- b.fetch(Register.s1);
835
- b.setComponentAttrs(true);
836
- b.putComponentOperations();
837
- b.openDynamicElement();
838
- b.didCreateElement(Register.s0);
839
- b.yield(this.attrsBlockNumber, []);
840
- b.setComponentAttrs(false);
841
- b.flushElement();
842
- b.label('BODY');
843
- b.invokeStaticBlock(blockFor(layout, compiler));
844
- b.fetch(Register.s1);
845
- b.jumpUnless('END');
846
- b.closeElement();
847
- b.label('END');
848
- b.load(Register.s1);
849
- b.stopLabels();
850
- let handle = b.commit();
851
- return this.compiled = handle;
852
- }
853
- }
854
- function blockFor(layout, compiler) {
855
- return new CompilableBlock(compiler, {
856
- block: {
857
- statements: layout.block.statements,
858
- parameters: EMPTY_ARRAY
859
- },
860
- containingLayout: layout
861
- });
862
- }
863
- class ComponentBuilder {
864
- constructor(builder) {
865
- this.builder = builder;
866
- }
867
- static(handle, args) {
868
- let [params, hash, _default, inverse] = args;
869
- let { builder } = this;
870
- if (handle !== null) {
871
- let { capabilities, compilable } = builder.compiler.resolveLayoutForHandle(handle);
872
- if (compilable) {
873
- builder.pushComponentDefinition(handle);
874
- builder.invokeStaticComponent(capabilities, compilable, null, params, hash, false, _default, inverse);
875
- } else {
876
- builder.pushComponentDefinition(handle);
877
- builder.invokeComponent(capabilities, null, params, hash, false, _default, inverse);
878
- }
879
- }
880
- }
881
- }
882
-
883
- class Labels {
884
- constructor() {
885
- this.labels = dict();
886
- this.targets = [];
887
- }
888
- label(name, index) {
889
- this.labels[name] = index;
890
- }
891
- target(at, target) {
892
- this.targets.push({ at, target });
893
- }
894
- patch(encoder) {
895
- let { targets, labels } = this;
896
- for (let i = 0; i < targets.length; i++) {
897
- let { at, target } = targets[i];
898
- let address = labels[target] - at;
899
- encoder.patch(at, address);
900
- }
901
- }
902
- }
903
- class StdOpcodeBuilder {
904
- constructor(compiler, size = 0) {
905
- this.size = size;
906
- this.encoder = new InstructionEncoder([]);
907
- this.labelsStack = new Stack();
908
- this.compiler = compiler;
909
- }
910
- static build(compiler, callback) {
911
- let builder = new StdOpcodeBuilder(compiler);
912
- callback(builder);
913
- return builder.commit();
914
- }
915
- push(name) {
916
- switch (arguments.length) {
917
- case 1:
918
- return this.encoder.encode(name, 0);
919
- case 2:
920
- return this.encoder.encode(name, 0, arguments[1]);
921
- case 3:
922
- return this.encoder.encode(name, 0, arguments[1], arguments[2]);
923
- default:
924
- return this.encoder.encode(name, 0, arguments[1], arguments[2], arguments[3]);
925
- }
926
- }
927
- pushMachine(name) {
928
- switch (arguments.length) {
929
- case 1:
930
- return this.encoder.encode(name, 1024 /* MACHINE_MASK */);
931
- case 2:
932
- return this.encoder.encode(name, 1024 /* MACHINE_MASK */, arguments[1]);
933
- case 3:
934
- return this.encoder.encode(name, 1024 /* MACHINE_MASK */, arguments[1], arguments[2]);
935
- default:
936
- return this.encoder.encode(name, 1024 /* MACHINE_MASK */, arguments[1], arguments[2], arguments[3]);
937
- }
938
- }
939
- commit() {
940
- this.pushMachine(24 /* Return */);
941
- return this.compiler.commit(this.size, this.encoder.buffer);
942
- }
943
- reserve(name) {
944
- this.encoder.encode(name, 0, -1);
945
- }
946
- reserveWithOperand(name, operand) {
947
- this.encoder.encode(name, 0, -1, operand);
948
- }
949
- reserveMachine(name) {
950
- this.encoder.encode(name, 1024 /* MACHINE_MASK */, -1);
951
- }
952
- ///
953
- main() {
954
- this.push(68 /* Main */, Register.s0);
955
- this.invokePreparedComponent(false, false, true);
956
- }
957
- appendHTML() {
958
- this.push(28 /* AppendHTML */);
959
- }
960
- appendSafeHTML() {
961
- this.push(29 /* AppendSafeHTML */);
962
- }
963
- appendDocumentFragment() {
964
- this.push(30 /* AppendDocumentFragment */);
965
- }
966
- appendNode() {
967
- this.push(31 /* AppendNode */);
968
- }
969
- appendText() {
970
- this.push(32 /* AppendText */);
971
- }
972
- beginComponentTransaction() {
973
- this.push(91 /* BeginComponentTransaction */);
974
- }
975
- commitComponentTransaction() {
976
- this.push(92 /* CommitComponentTransaction */);
977
- }
978
- pushDynamicScope() {
979
- this.push(44 /* PushDynamicScope */);
980
- }
981
- popDynamicScope() {
982
- this.push(45 /* PopDynamicScope */);
983
- }
984
- pushRemoteElement() {
985
- this.push(41 /* PushRemoteElement */);
986
- }
987
- popRemoteElement() {
988
- this.push(42 /* PopRemoteElement */);
989
- }
990
- pushRootScope(symbols, bindCallerScope) {
991
- this.push(20 /* RootScope */, symbols, bindCallerScope ? 1 : 0);
992
- }
993
- pushVirtualRootScope(register) {
994
- this.push(21 /* VirtualRootScope */, register);
995
- }
996
- pushChildScope() {
997
- this.push(22 /* ChildScope */);
998
- }
999
- popScope() {
1000
- this.push(23 /* PopScope */);
1001
- }
1002
- prepareArgs(state) {
1003
- this.push(79 /* PrepareArgs */, state);
1004
- }
1005
- createComponent(state, hasDefault) {
1006
- let flag = hasDefault | 0;
1007
- this.push(81 /* CreateComponent */, flag, state);
1008
- }
1009
- registerComponentDestructor(state) {
1010
- this.push(82 /* RegisterComponentDestructor */, state);
1011
- }
1012
- putComponentOperations() {
1013
- this.push(83 /* PutComponentOperations */);
1014
- }
1015
- getComponentSelf(state) {
1016
- this.push(84 /* GetComponentSelf */, state);
1017
- }
1018
- getComponentTagName(state) {
1019
- this.push(85 /* GetComponentTagName */, state);
1020
- }
1021
- getComponentLayout(state) {
1022
- this.push(86 /* GetComponentLayout */, state);
1023
- }
1024
- setupForEval(state) {
1025
- this.push(87 /* SetupForEval */, state);
1026
- }
1027
- invokeComponentLayout(state) {
1028
- this.push(90 /* InvokeComponentLayout */, state);
1029
- }
1030
- didCreateElement(state) {
1031
- this.push(93 /* DidCreateElement */, state);
1032
- }
1033
- didRenderLayout(state) {
1034
- this.push(94 /* DidRenderLayout */, state);
1035
- }
1036
- pushFrame() {
1037
- this.pushMachine(57 /* PushFrame */);
1038
- }
1039
- popFrame() {
1040
- this.pushMachine(58 /* PopFrame */);
1041
- }
1042
- pushSmallFrame() {
1043
- this.pushMachine(59 /* PushSmallFrame */);
1044
- }
1045
- popSmallFrame() {
1046
- this.pushMachine(60 /* PopSmallFrame */);
1047
- }
1048
- invokeVirtual() {
1049
- this.pushMachine(49 /* InvokeVirtual */);
1050
- }
1051
- invokeYield() {
1052
- this.push(51 /* InvokeYield */);
1053
- }
1054
- toBoolean() {
1055
- this.push(63 /* ToBoolean */);
1056
- }
1057
- invokePreparedComponent(hasBlock, bindableBlocks, bindableAtNames, populateLayout = null) {
1058
- this.beginComponentTransaction();
1059
- this.pushDynamicScope();
1060
- this.createComponent(Register.s0, hasBlock);
1061
- // this has to run after createComponent to allow
1062
- // for late-bound layouts, but a caller is free
1063
- // to populate the layout earlier if it wants to
1064
- // and do nothing here.
1065
- if (populateLayout) populateLayout();
1066
- this.registerComponentDestructor(Register.s0);
1067
- this.getComponentSelf(Register.s0);
1068
- this.pushVirtualRootScope(Register.s0);
1069
- this.setVariable(0);
1070
- this.setupForEval(Register.s0);
1071
- if (bindableAtNames) this.setNamedVariables(Register.s0);
1072
- if (bindableBlocks) this.setBlocks(Register.s0);
1073
- this.pop();
1074
- this.invokeComponentLayout(Register.s0);
1075
- this.didRenderLayout(Register.s0);
1076
- this.popFrame();
1077
- this.popScope();
1078
- this.popDynamicScope();
1079
- this.commitComponentTransaction();
1080
- }
1081
- get pos() {
1082
- return this.encoder.typePos;
1083
- }
1084
- get nextPos() {
1085
- return this.encoder.size;
1086
- }
1087
- ///
1088
- compileInline(sexp) {
1089
- return this.compiler.compileInline(sexp, this);
1090
- }
1091
- compileBlock(name, params, hash, template, inverse) {
1092
- this.compiler.compileBlock(name, params, hash, template, inverse, this);
1093
- }
1094
- label(name) {
1095
- this.labels.label(name, this.nextPos);
1096
- }
1097
- // helpers
1098
- get labels() {
1099
- return this.labelsStack.current;
1100
- }
1101
- startLabels() {
1102
- this.labelsStack.push(new Labels());
1103
- }
1104
- stopLabels() {
1105
- let label = this.labelsStack.pop();
1106
- label.patch(this.encoder);
1107
- }
1108
- // components
1109
- pushCurriedComponent() {
1110
- this.push(74 /* PushCurriedComponent */);
1111
- }
1112
- pushDynamicComponentInstance() {
1113
- this.push(73 /* PushDynamicComponentInstance */);
1114
- }
1115
- // dom
1116
- openDynamicElement() {
1117
- this.push(34 /* OpenDynamicElement */);
1118
- }
1119
- flushElement() {
1120
- this.push(38 /* FlushElement */);
1121
- }
1122
- closeElement() {
1123
- this.push(39 /* CloseElement */);
1124
- }
1125
- // lists
1126
- putIterator() {
1127
- this.push(66 /* PutIterator */);
1128
- }
1129
- enterList(start) {
1130
- this.reserve(64 /* EnterList */);
1131
- this.labels.target(this.pos, start);
1132
- }
1133
- exitList() {
1134
- this.push(65 /* ExitList */);
1135
- }
1136
- iterate(breaks) {
1137
- this.reserve(67 /* Iterate */);
1138
- this.labels.target(this.pos, breaks);
1139
- }
1140
- // expressions
1141
- setNamedVariables(state) {
1142
- this.push(2 /* SetNamedVariables */, state);
1143
- }
1144
- setBlocks(state) {
1145
- this.push(3 /* SetBlocks */, state);
1146
- }
1147
- setVariable(symbol) {
1148
- this.push(4 /* SetVariable */, symbol);
1149
- }
1150
- setBlock(symbol) {
1151
- this.push(5 /* SetBlock */, symbol);
1152
- }
1153
- getVariable(symbol) {
1154
- this.push(6 /* GetVariable */, symbol);
1155
- }
1156
- getBlock(symbol) {
1157
- this.push(8 /* GetBlock */, symbol);
1158
- }
1159
- hasBlock(symbol) {
1160
- this.push(9 /* HasBlock */, symbol);
1161
- }
1162
- concat(size) {
1163
- this.push(11 /* Concat */, size);
1164
- }
1165
- load(register) {
1166
- this.push(18 /* Load */, register);
1167
- }
1168
- fetch(register) {
1169
- this.push(19 /* Fetch */, register);
1170
- }
1171
- dup(register = Register.sp, offset = 0) {
1172
- return this.push(16 /* Dup */, register, offset);
1173
- }
1174
- pop(count = 1) {
1175
- return this.push(17 /* Pop */, count);
1176
- }
1177
- // vm
1178
- returnTo(label) {
1179
- this.reserveMachine(25 /* ReturnTo */);
1180
- this.labels.target(this.pos, label);
1181
- }
1182
- primitiveReference() {
1183
- this.push(14 /* PrimitiveReference */);
1184
- }
1185
- reifyU32() {
1186
- this.push(15 /* ReifyU32 */);
1187
- }
1188
- enter(args) {
1189
- this.push(61 /* Enter */, args);
1190
- }
1191
- exit() {
1192
- this.push(62 /* Exit */);
1193
- }
1194
- return() {
1195
- this.pushMachine(24 /* Return */);
1196
- }
1197
- jump(target) {
1198
- this.reserveMachine(52 /* Jump */);
1199
- this.labels.target(this.pos, target);
1200
- }
1201
- jumpIf(target) {
1202
- this.reserve(53 /* JumpIf */);
1203
- this.labels.target(this.pos, target);
1204
- }
1205
- jumpUnless(target) {
1206
- this.reserve(54 /* JumpUnless */);
1207
- this.labels.target(this.pos, target);
1208
- }
1209
- jumpEq(value, target) {
1210
- this.reserveWithOperand(55 /* JumpEq */, value);
1211
- this.labels.target(this.pos, target);
1212
- }
1213
- assertSame() {
1214
- this.push(56 /* AssertSame */);
1215
- }
1216
- pushEmptyArgs() {
1217
- this.push(77 /* PushEmptyArgs */);
1218
- }
1219
- switch(_opcode, callback) {
1220
- // Setup the switch DSL
1221
- let clauses = [];
1222
- let count = 0;
1223
- function when(match, callback) {
1224
- clauses.push({ match, callback, label: `CLAUSE${count++}` });
1225
- }
1226
- // Call the callback
1227
- callback(when);
1228
- // Emit the opcodes for the switch
1229
- this.enter(2);
1230
- this.assertSame();
1231
- this.reifyU32();
1232
- this.startLabels();
1233
- // First, emit the jump opcodes. We don't need a jump for the last
1234
- // opcode, since it bleeds directly into its clause.
1235
- clauses.slice(0, -1).forEach(clause => this.jumpEq(clause.match, clause.label));
1236
- // Enumerate the clauses in reverse order. Earlier matches will
1237
- // require fewer checks.
1238
- for (let i = clauses.length - 1; i >= 0; i--) {
1239
- let clause = clauses[i];
1240
- this.label(clause.label);
1241
- this.pop(2);
1242
- clause.callback();
1243
- // The first match is special: it is placed directly before the END
1244
- // label, so no additional jump is needed at the end of it.
1245
- if (i !== 0) {
1246
- this.jump('END');
1247
- }
1248
- }
1249
- this.label('END');
1250
- this.stopLabels();
1251
- this.exit();
1252
- }
1253
- stdAppend(trusting) {
1254
- this.switch(this.contentType(), when => {
1255
- when(1 /* String */, () => {
1256
- if (trusting) {
1257
- this.assertSame();
1258
- this.appendHTML();
1259
- } else {
1260
- this.appendText();
1261
- }
1262
- });
1263
- when(0 /* Component */, () => {
1264
- this.pushCurriedComponent();
1265
- this.pushDynamicComponentInstance();
1266
- this.invokeBareComponent();
1267
- });
1268
- when(3 /* SafeString */, () => {
1269
- this.assertSame();
1270
- this.appendSafeHTML();
1271
- });
1272
- when(4 /* Fragment */, () => {
1273
- this.assertSame();
1274
- this.appendDocumentFragment();
1275
- });
1276
- when(5 /* Node */, () => {
1277
- this.assertSame();
1278
- this.appendNode();
1279
- });
1280
- });
1281
- }
1282
- populateLayout(state) {
1283
- this.push(89 /* PopulateLayout */, state);
1284
- }
1285
- invokeBareComponent() {
1286
- this.fetch(Register.s0);
1287
- this.dup(Register.sp, 1);
1288
- this.load(Register.s0);
1289
- this.pushFrame();
1290
- this.pushEmptyArgs();
1291
- this.prepareArgs(Register.s0);
1292
- this.invokePreparedComponent(false, false, true, () => {
1293
- this.getComponentLayout(Register.s0);
1294
- this.populateLayout(Register.s0);
1295
- });
1296
- this.load(Register.s0);
1297
- }
1298
- isComponent() {
1299
- this.push(69 /* IsComponent */);
1300
- }
1301
- contentType() {
1302
- this.push(70 /* ContentType */);
1303
- }
1304
- pushBlockScope() {
1305
- this.push(47 /* PushBlockScope */);
1306
- }
1307
- }
1308
- class OpcodeBuilder extends StdOpcodeBuilder {
1309
- constructor(compiler, containingLayout) {
1310
- super(compiler, containingLayout ? containingLayout.block.symbols.length : 0);
1311
- this.containingLayout = containingLayout;
1312
- this.component = new ComponentBuilder(this);
1313
- this.expressionCompiler = expressionCompiler();
1314
- this.isComponentAttrs = false;
1315
- this.constants = compiler.constants;
1316
- this.stdLib = compiler.stdLib;
1317
- }
1318
- /// MECHANICS
1319
- get referrer() {
1320
- return this.containingLayout && this.containingLayout.referrer;
1321
- }
1322
- setComponentAttrs(enabled) {
1323
- this.isComponentAttrs = enabled;
1324
- }
1325
- expr(expression) {
1326
- if (Array.isArray(expression)) {
1327
- this.expressionCompiler.compile(expression, this);
1328
- } else {
1329
- this.pushPrimitiveReference(expression);
1330
- }
1331
- }
1332
- ///
1333
- // args
1334
- pushArgs(names, flags) {
1335
- let serialized = this.constants.stringArray(names);
1336
- this.push(76 /* PushArgs */, serialized, flags);
1337
- }
1338
- pushYieldableBlock(block) {
1339
- this.pushSymbolTable(block && block.symbolTable);
1340
- this.pushBlockScope();
1341
- this.pushBlock(block);
1342
- }
1343
- curryComponent(definition,
1344
- /* TODO: attrs: Option<RawInlineBlock>, */params, hash, synthetic) {
1345
- let referrer = this.containingLayout.referrer;
1346
- this.pushFrame();
1347
- this.compileArgs(params, hash, null, synthetic);
1348
- this.push(80 /* CaptureArgs */);
1349
- this.expr(definition);
1350
- this.push(71 /* CurryComponent */, this.constants.serializable(referrer));
1351
- this.popFrame();
1352
- this.fetch(Register.v0);
1353
- }
1354
- pushSymbolTable(table) {
1355
- if (table) {
1356
- let constant = this.constants.serializable(table);
1357
- this.push(48 /* PushSymbolTable */, constant);
1358
- } else {
1359
- this.primitive(null);
1360
- }
1361
- }
1362
- invokeComponent(capabilities, attrs, params, hash, synthetic, block, inverse = null, layout) {
1363
- this.fetch(Register.s0);
1364
- this.dup(Register.sp, 1);
1365
- this.load(Register.s0);
1366
- this.pushFrame();
1367
- let bindableBlocks = !!(block || inverse || attrs);
1368
- let bindableAtNames = capabilities === true || capabilities.prepareArgs || !!(hash && hash[0].length !== 0);
1369
- let blocks = { main: block, else: inverse, attrs };
1370
- this.compileArgs(params, hash, blocks, synthetic);
1371
- this.prepareArgs(Register.s0);
1372
- this.invokePreparedComponent(block !== null, bindableBlocks, bindableAtNames, () => {
1373
- if (layout) {
1374
- this.pushSymbolTable(layout.symbolTable);
1375
- this.pushLayout(layout);
1376
- this.resolveLayout();
1377
- } else {
1378
- this.getComponentLayout(Register.s0);
1379
- }
1380
- this.populateLayout(Register.s0);
1381
- });
1382
- this.load(Register.s0);
1383
- }
1384
- invokeStaticComponent(capabilities, layout, attrs, params, hash, synthetic, block, inverse = null) {
1385
- let { symbolTable } = layout;
1386
- let bailOut = symbolTable.hasEval || capabilities.prepareArgs;
1387
- if (bailOut) {
1388
- this.invokeComponent(capabilities, attrs, params, hash, synthetic, block, inverse, layout);
1389
- return;
1390
- }
1391
- this.fetch(Register.s0);
1392
- this.dup(Register.sp, 1);
1393
- this.load(Register.s0);
1394
- let { symbols } = symbolTable;
1395
- if (capabilities.createArgs) {
1396
- this.pushFrame();
1397
- this.compileArgs(null, hash, null, synthetic);
1398
- }
1399
- this.beginComponentTransaction();
1400
- if (capabilities.dynamicScope) {
1401
- this.pushDynamicScope();
1402
- }
1403
- if (capabilities.createInstance) {
1404
- this.createComponent(Register.s0, block !== null);
1405
- }
1406
- if (capabilities.createArgs) {
1407
- this.popFrame();
1408
- }
1409
- this.pushFrame();
1410
- this.registerComponentDestructor(Register.s0);
1411
- let bindings = [];
1412
- this.getComponentSelf(Register.s0);
1413
- bindings.push({ symbol: 0, isBlock: false });
1414
- for (let i = 0; i < symbols.length; i++) {
1415
- let symbol = symbols[i];
1416
- switch (symbol.charAt(0)) {
1417
- case '&':
1418
- let callerBlock = null;
1419
- if (symbol === '&default') {
1420
- callerBlock = block;
1421
- } else if (symbol === '&inverse') {
1422
- callerBlock = inverse;
1423
- } else if (symbol === ATTRS_BLOCK) {
1424
- callerBlock = attrs;
1425
- } else {
1426
- throw unreachable();
1427
- }
1428
- if (callerBlock) {
1429
- this.pushYieldableBlock(callerBlock);
1430
- bindings.push({ symbol: i + 1, isBlock: true });
1431
- } else {
1432
- this.pushYieldableBlock(null);
1433
- bindings.push({ symbol: i + 1, isBlock: true });
1434
- }
1435
- break;
1436
- case '@':
1437
- if (!hash) {
1438
- break;
1439
- }
1440
- let [keys, values] = hash;
1441
- let lookupName = symbol;
1442
- if (synthetic) {
1443
- lookupName = symbol.slice(1);
1444
- }
1445
- let index = keys.indexOf(lookupName);
1446
- if (index !== -1) {
1447
- this.expr(values[index]);
1448
- bindings.push({ symbol: i + 1, isBlock: false });
1449
- }
1450
- break;
1451
- }
1452
- }
1453
- this.pushRootScope(symbols.length + 1, !!(block || inverse || attrs));
1454
- for (let i = bindings.length - 1; i >= 0; i--) {
1455
- let { symbol, isBlock } = bindings[i];
1456
- if (isBlock) {
1457
- this.setBlock(symbol);
1458
- } else {
1459
- this.setVariable(symbol);
1460
- }
1461
- }
1462
- this.invokeStatic(layout);
1463
- if (capabilities.createInstance) {
1464
- this.didRenderLayout(Register.s0);
1465
- }
1466
- this.popFrame();
1467
- this.popScope();
1468
- if (capabilities.dynamicScope) {
1469
- this.popDynamicScope();
1470
- }
1471
- this.commitComponentTransaction();
1472
- this.load(Register.s0);
1473
- }
1474
- dynamicComponent(definition, attrs, params, hash, synthetic, block, inverse = null) {
1475
- this.replayable({
1476
- args: () => {
1477
- this.expr(definition);
1478
- this.dup();
1479
- return 2;
1480
- },
1481
- body: () => {
1482
- this.jumpUnless('ELSE');
1483
- this.resolveDynamicComponent(this.containingLayout.referrer);
1484
- this.pushDynamicComponentInstance();
1485
- this.invokeComponent(true, attrs, params, hash, synthetic, block, inverse);
1486
- this.label('ELSE');
1487
- }
1488
- });
1489
- }
1490
- yield(to, params) {
1491
- this.compileArgs(params, null, null, false);
1492
- this.getBlock(to);
1493
- this.resolveBlock();
1494
- this.invokeYield();
1495
- this.popScope();
1496
- this.popFrame();
1497
- }
1498
- guardedAppend(expression, trusting) {
1499
- this.pushFrame();
1500
- this.expr(expression);
1501
- this.pushMachine(50 /* InvokeStatic */, this.stdLib.getAppend(trusting));
1502
- this.popFrame();
1503
- }
1504
- invokeStaticBlock(block, callerCount = 0) {
1505
- let { parameters } = block.symbolTable;
1506
- let calleeCount = parameters.length;
1507
- let count = Math.min(callerCount, calleeCount);
1508
- this.pushFrame();
1509
- if (count) {
1510
- this.pushChildScope();
1511
- for (let i = 0; i < count; i++) {
1512
- this.dup(Register.fp, callerCount - i);
1513
- this.setVariable(parameters[i]);
1514
- }
1515
- }
1516
- this.pushBlock(block);
1517
- this.resolveBlock();
1518
- this.invokeVirtual();
1519
- if (count) {
1520
- this.popScope();
1521
- }
1522
- this.popFrame();
1523
- }
1524
- /// CONVENIENCE
1525
- // internal helpers
1526
- string(_string) {
1527
- return this.constants.string(_string);
1528
- }
1529
- names(_names) {
1530
- let names = [];
1531
- for (let i = 0; i < _names.length; i++) {
1532
- let n = _names[i];
1533
- names[i] = this.constants.string(n);
1534
- }
1535
- return this.constants.array(names);
1536
- }
1537
- symbols(symbols) {
1538
- return this.constants.array(symbols);
1539
- }
1540
- // vm
1541
- primitive(_primitive) {
1542
- let type = 0 /* NUMBER */;
1543
- let primitive;
1544
- switch (typeof _primitive) {
1545
- case 'number':
1546
- if (_primitive % 1 === 0) {
1547
- if (_primitive > -1) {
1548
- primitive = _primitive;
1549
- } else {
1550
- primitive = this.constants.number(_primitive);
1551
- type = 4 /* NEGATIVE */;
1552
- }
1553
- } else {
1554
- primitive = this.constants.number(_primitive);
1555
- type = 1 /* FLOAT */;
1556
- }
1557
- break;
1558
- case 'string':
1559
- primitive = this.string(_primitive);
1560
- type = 2 /* STRING */;
1561
- break;
1562
- case 'boolean':
1563
- primitive = _primitive | 0;
1564
- type = 3 /* BOOLEAN_OR_VOID */;
1565
- break;
1566
- case 'object':
1567
- // assume null
1568
- primitive = 2;
1569
- type = 3 /* BOOLEAN_OR_VOID */;
1570
- break;
1571
- case 'undefined':
1572
- primitive = 3;
1573
- type = 3 /* BOOLEAN_OR_VOID */;
1574
- break;
1575
- default:
1576
- throw new Error('Invalid primitive passed to pushPrimitive');
1577
- }
1578
- let immediate = this.sizeImmediate(primitive << 3 | type, primitive);
1579
- this.push(13 /* Primitive */, immediate);
1580
- }
1581
- sizeImmediate(shifted, primitive) {
1582
- if (shifted >= 65535 /* MAX_SIZE */ || shifted < 0) {
1583
- return this.constants.number(primitive) << 3 | 5 /* BIG_NUM */;
1584
- }
1585
- return shifted;
1586
- }
1587
- pushPrimitiveReference(primitive) {
1588
- this.primitive(primitive);
1589
- this.primitiveReference();
1590
- }
1591
- // components
1592
- pushComponentDefinition(handle) {
1593
- this.push(72 /* PushComponentDefinition */, this.constants.handle(handle));
1594
- }
1595
- resolveDynamicComponent(referrer) {
1596
- this.push(75 /* ResolveDynamicComponent */, this.constants.serializable(referrer));
1597
- }
1598
- staticComponentHelper(tag, hash, template) {
1599
- let { handle, capabilities, compilable } = this.compiler.resolveLayoutForTag(tag, this.referrer);
1600
- if (handle !== null && capabilities !== null) {
1601
- if (compilable) {
1602
- if (hash) {
1603
- for (let i = 0; i < hash.length; i = i + 2) {
1604
- hash[i][0] = `@${hash[i][0]}`;
1605
- }
1606
- }
1607
- this.pushComponentDefinition(handle);
1608
- this.invokeStaticComponent(capabilities, compilable, null, null, hash, false, template && template);
1609
- return true;
1610
- }
1611
- }
1612
- return false;
1613
- }
1614
- // partial
1615
- invokePartial(referrer, symbols, evalInfo) {
1616
- let _meta = this.constants.serializable(referrer);
1617
- let _symbols = this.constants.stringArray(symbols);
1618
- let _evalInfo = this.constants.array(evalInfo);
1619
- this.push(95 /* InvokePartial */, _meta, _symbols, _evalInfo);
1620
- }
1621
- resolveMaybeLocal(name) {
1622
- this.push(96 /* ResolveMaybeLocal */, this.string(name));
1623
- }
1624
- // debugger
1625
- debugger(symbols, evalInfo) {
1626
- this.push(97 /* Debugger */, this.constants.stringArray(symbols), this.constants.array(evalInfo));
1627
- }
1628
- // dom
1629
- text(text) {
1630
- this.push(26 /* Text */, this.constants.string(text));
1631
- }
1632
- openPrimitiveElement(tag) {
1633
- this.push(33 /* OpenElement */, this.constants.string(tag));
1634
- }
1635
- modifier(locator, params, hash) {
1636
- this.pushFrame();
1637
- this.compileArgs(params, hash, null, true);
1638
- this.push(40 /* Modifier */, this.constants.handle(locator));
1639
- this.popFrame();
1640
- }
1641
- comment(_comment) {
1642
- let comment = this.constants.string(_comment);
1643
- this.push(27 /* Comment */, comment);
1644
- }
1645
- dynamicAttr(_name, _namespace, trusting) {
1646
- let name = this.constants.string(_name);
1647
- let namespace = _namespace ? this.constants.string(_namespace) : 0;
1648
- if (this.isComponentAttrs) {
1649
- this.push(37 /* ComponentAttr */, name, trusting === true ? 1 : 0, namespace);
1650
- } else {
1651
- this.push(36 /* DynamicAttr */, name, trusting === true ? 1 : 0, namespace);
1652
- }
1653
- }
1654
- staticAttr(_name, _namespace, _value) {
1655
- let name = this.constants.string(_name);
1656
- let namespace = _namespace ? this.constants.string(_namespace) : 0;
1657
- if (this.isComponentAttrs) {
1658
- this.pushPrimitiveReference(_value);
1659
- this.push(37 /* ComponentAttr */, name, 1, namespace);
1660
- } else {
1661
- let value = this.constants.string(_value);
1662
- this.push(35 /* StaticAttr */, name, value, namespace);
1663
- }
1664
- }
1665
- // expressions
1666
- hasBlockParams(to) {
1667
- this.getBlock(to);
1668
- this.resolveBlock();
1669
- this.push(10 /* HasBlockParams */);
1670
- }
1671
- getProperty(key) {
1672
- this.push(7 /* GetProperty */, this.string(key));
1673
- }
1674
- helper(helper, params, hash) {
1675
- this.pushFrame();
1676
- this.compileArgs(params, hash, null, true);
1677
- this.push(1 /* Helper */, this.constants.handle(helper));
1678
- this.popFrame();
1679
- this.fetch(Register.v0);
1680
- }
1681
- bindDynamicScope(_names) {
1682
- this.push(43 /* BindDynamicScope */, this.names(_names));
1683
- }
1684
- // convenience methods
1685
- /**
1686
- * A convenience for pushing some arguments on the stack and
1687
- * running some code if the code needs to be re-executed during
1688
- * updating execution if some of the arguments have changed.
1689
- *
1690
- * # Initial Execution
1691
- *
1692
- * The `args` function should push zero or more arguments onto
1693
- * the stack and return the number of arguments pushed.
1694
- *
1695
- * The `body` function provides the instructions to execute both
1696
- * during initial execution and during updating execution.
1697
- *
1698
- * Internally, this function starts by pushing a new frame, so
1699
- * that the body can return and sets the return point ($ra) to
1700
- * the ENDINITIAL label.
1701
- *
1702
- * It then executes the `args` function, which adds instructions
1703
- * responsible for pushing the arguments for the block to the
1704
- * stack. These arguments will be restored to the stack before
1705
- * updating execution.
1706
- *
1707
- * Next, it adds the Enter opcode, which marks the current position
1708
- * in the DOM, and remembers the current $pc (the next instruction)
1709
- * as the first instruction to execute during updating execution.
1710
- *
1711
- * Next, it runs `body`, which adds the opcodes that should
1712
- * execute both during initial execution and during updating execution.
1713
- * If the `body` wishes to finish early, it should Jump to the
1714
- * `FINALLY` label.
1715
- *
1716
- * Next, it adds the FINALLY label, followed by:
1717
- *
1718
- * - the Exit opcode, which finalizes the marked DOM started by the
1719
- * Enter opcode.
1720
- * - the Return opcode, which returns to the current return point
1721
- * ($ra).
1722
- *
1723
- * Finally, it adds the ENDINITIAL label followed by the PopFrame
1724
- * instruction, which restores $fp, $sp and $ra.
1725
- *
1726
- * # Updating Execution
1727
- *
1728
- * Updating execution for this `replayable` occurs if the `body` added an
1729
- * assertion, via one of the `JumpIf`, `JumpUnless` or `AssertSame` opcodes.
1730
- *
1731
- * If, during updating executon, the assertion fails, the initial VM is
1732
- * restored, and the stored arguments are pushed onto the stack. The DOM
1733
- * between the starting and ending markers is cleared, and the VM's cursor
1734
- * is set to the area just cleared.
1735
- *
1736
- * The return point ($ra) is set to -1, the exit instruction.
1737
- *
1738
- * Finally, the $pc is set to to the instruction saved off by the
1739
- * Enter opcode during initial execution, and execution proceeds as
1740
- * usual.
1741
- *
1742
- * The only difference is that when a `Return` instruction is
1743
- * encountered, the program jumps to -1 rather than the END label,
1744
- * and the PopFrame opcode is not needed.
1745
- */
1746
- replayable({ args, body }) {
1747
- // Start a new label frame, to give END and RETURN
1748
- // a unique meaning.
1749
- this.startLabels();
1750
- this.pushFrame();
1751
- // If the body invokes a block, its return will return to
1752
- // END. Otherwise, the return in RETURN will return to END.
1753
- this.returnTo('ENDINITIAL');
1754
- // Push the arguments onto the stack. The args() function
1755
- // tells us how many stack elements to retain for re-execution
1756
- // when updating.
1757
- let count = args();
1758
- // Start a new updating closure, remembering `count` elements
1759
- // from the stack. Everything after this point, and before END,
1760
- // will execute both initially and to update the block.
1761
- //
1762
- // The enter and exit opcodes also track the area of the DOM
1763
- // associated with this block. If an assertion inside the block
1764
- // fails (for example, the test value changes from true to false
1765
- // in an #if), the DOM is cleared and the program is re-executed,
1766
- // restoring `count` elements to the stack and executing the
1767
- // instructions between the enter and exit.
1768
- this.enter(count);
1769
- // Evaluate the body of the block. The body of the block may
1770
- // return, which will jump execution to END during initial
1771
- // execution, and exit the updating routine.
1772
- body();
1773
- // All execution paths in the body should run the FINALLY once
1774
- // they are done. It is executed both during initial execution
1775
- // and during updating execution.
1776
- this.label('FINALLY');
1777
- // Finalize the DOM.
1778
- this.exit();
1779
- // In initial execution, this is a noop: it returns to the
1780
- // immediately following opcode. In updating execution, this
1781
- // exits the updating routine.
1782
- this.return();
1783
- // Cleanup code for the block. Runs on initial execution
1784
- // but not on updating.
1785
- this.label('ENDINITIAL');
1786
- this.popFrame();
1787
- this.stopLabels();
1788
- }
1789
- /**
1790
- * A specialized version of the `replayable` convenience that allows the
1791
- * caller to provide different code based upon whether the item at
1792
- * the top of the stack is true or false.
1793
- *
1794
- * As in `replayable`, the `ifTrue` and `ifFalse` code can invoke `return`.
1795
- *
1796
- * During the initial execution, a `return` will continue execution
1797
- * in the cleanup code, which finalizes the current DOM block and pops
1798
- * the current frame.
1799
- *
1800
- * During the updating execution, a `return` will exit the updating
1801
- * routine, as it can reuse the DOM block and is always only a single
1802
- * frame deep.
1803
- */
1804
- replayableIf({ args, ifTrue, ifFalse }) {
1805
- this.replayable({
1806
- args,
1807
- body: () => {
1808
- // If the conditional is false, jump to the ELSE label.
1809
- this.jumpUnless('ELSE');
1810
- // Otherwise, execute the code associated with the true branch.
1811
- ifTrue();
1812
- // We're done, so return. In the initial execution, this runs
1813
- // the cleanup code. In the updating VM, it exits the updating
1814
- // routine.
1815
- this.jump('FINALLY');
1816
- this.label('ELSE');
1817
- // If the conditional is false, and code associatied ith the
1818
- // false branch was provided, execute it. If there was no code
1819
- // associated with the false branch, jumping to the else statement
1820
- // has no other behavior.
1821
- if (ifFalse) {
1822
- ifFalse();
1823
- }
1824
- }
1825
- });
1826
- }
1827
- inlineBlock(block) {
1828
- return new CompilableBlock(this.compiler, {
1829
- block,
1830
- containingLayout: this.containingLayout
1831
- });
1832
- }
1833
- evalSymbols() {
1834
- let { containingLayout: { block } } = this;
1835
- return block.hasEval ? block.symbols : null;
1836
- }
1837
- compileParams(params) {
1838
- if (!params) return 0;
1839
- for (let i = 0; i < params.length; i++) {
1840
- this.expr(params[i]);
1841
- }
1842
- return params.length;
1843
- }
1844
- compileArgs(params, hash, blocks, synthetic) {
1845
- if (blocks) {
1846
- this.pushYieldableBlock(blocks.main);
1847
- this.pushYieldableBlock(blocks.else);
1848
- this.pushYieldableBlock(blocks.attrs);
1849
- }
1850
- let count = this.compileParams(params);
1851
- let flags = count << 4;
1852
- if (synthetic) flags |= 0b1000;
1853
- if (blocks) {
1854
- flags |= 0b111;
1855
- }
1856
- let names = EMPTY_ARRAY;
1857
- if (hash) {
1858
- names = hash[0];
1859
- let val = hash[1];
1860
- for (let i = 0; i < val.length; i++) {
1861
- this.expr(val[i]);
1862
- }
1863
- }
1864
- this.pushArgs(names, flags);
1865
- }
1866
- template(block) {
1867
- if (!block) return null;
1868
- return this.inlineBlock(block);
1869
- }
1870
- }
1871
- class LazyOpcodeBuilder extends OpcodeBuilder {
1872
- pushBlock(block) {
1873
- if (block) {
1874
- this.pushOther(block);
1875
- } else {
1876
- this.primitive(null);
1877
- }
1878
- }
1879
- resolveBlock() {
1880
- this.push(46 /* CompileBlock */);
1881
- }
1882
- pushLayout(layout) {
1883
- if (layout) {
1884
- this.pushOther(layout);
1885
- } else {
1886
- this.primitive(null);
1887
- }
1888
- }
1889
- resolveLayout() {
1890
- this.push(46 /* CompileBlock */);
1891
- }
1892
- invokeStatic(compilable) {
1893
- this.pushOther(compilable);
1894
- this.push(46 /* CompileBlock */);
1895
- this.pushMachine(49 /* InvokeVirtual */);
1896
- }
1897
- pushOther(value) {
1898
- this.push(12 /* Constant */, this.other(value));
1899
- }
1900
- other(value) {
1901
- return this.constants.other(value);
1902
- }
1903
- }
1904
- class EagerOpcodeBuilder extends OpcodeBuilder {
1905
- pushBlock(block) {
1906
- let handle = block ? block.compile() : null;
1907
- this.primitive(handle);
1908
- }
1909
- resolveBlock() {
1910
- return;
1911
- }
1912
- pushLayout(layout) {
1913
- if (layout) {
1914
- this.primitive(layout.compile());
1915
- } else {
1916
- this.primitive(null);
1917
- }
1918
- }
1919
- resolveLayout() {}
1920
- invokeStatic(compilable) {
1921
- let handle = compilable.compile();
1922
- // If the handle for the invoked component is not yet known (for example,
1923
- // because this is a recursive invocation and we're still compiling), push a
1924
- // function that will produce the correct handle when the heap is
1925
- // serialized.
1926
- if (handle === PLACEHOLDER_HANDLE$1) {
1927
- this.pushMachine(50 /* InvokeStatic */, () => compilable.compile());
1928
- } else {
1929
- this.pushMachine(50 /* InvokeStatic */, handle);
1930
- }
1931
- }
1932
- }
1933
-
1934
- class LazyCompiler extends AbstractCompiler {
1935
- // FIXME: turn to static method
1936
- constructor(lookup, resolver, macros) {
1937
- let constants = new LazyConstants(resolver);
1938
- let program = new Program(constants);
1939
- super(macros, program, lookup);
1940
- }
1941
- builderFor(containingLayout) {
1942
- return new LazyOpcodeBuilder(this, containingLayout);
1943
- }
1944
- }
1945
-
1946
- class PartialDefinition {
1947
- constructor(name, // for debugging
1948
- template) {
1949
- this.name = name;
1950
- this.template = template;
1951
- }
1952
- getPartial() {
1953
- let partial = this.template.asPartial();
1954
- let handle = partial.compile();
1955
- return { symbolTable: partial.symbolTable, handle };
1956
- }
1957
- }
1958
-
1959
- let clientId = 0;
1960
- function templateFactory({ id: templateId, meta, block }) {
1961
- let parsedBlock;
1962
- let id = templateId || `client-${clientId++}`;
1963
- let create = (compiler, envMeta) => {
1964
- let newMeta = envMeta ? assign({}, envMeta, meta) : meta;
1965
- if (!parsedBlock) {
1966
- parsedBlock = JSON.parse(block);
1967
- }
1968
- return new TemplateImpl(compiler, { id, block: parsedBlock, referrer: newMeta });
1969
- };
1970
- return { id, meta, create };
1971
- }
1972
- class TemplateImpl {
1973
- constructor(compiler, parsedLayout) {
1974
- this.compiler = compiler;
1975
- this.parsedLayout = parsedLayout;
1976
- this.layout = null;
1977
- this.partial = null;
1978
- this.wrappedLayout = null;
1979
- let { block } = parsedLayout;
1980
- this.symbols = block.symbols;
1981
- this.hasEval = block.hasEval;
1982
- this.referrer = parsedLayout.referrer;
1983
- this.id = parsedLayout.id || `client-${clientId++}`;
1984
- }
1985
- asLayout() {
1986
- if (this.layout) return this.layout;
1987
- return this.layout = new CompilableProgram(this.compiler, Object.assign({}, this.parsedLayout, { asPartial: false }));
1988
- }
1989
- asPartial() {
1990
- if (this.partial) return this.partial;
1991
- return this.layout = new CompilableProgram(this.compiler, Object.assign({}, this.parsedLayout, { asPartial: true }));
1992
- }
1993
- asWrappedLayout() {
1994
- if (this.wrappedLayout) return this.wrappedLayout;
1995
- return this.wrappedLayout = new WrappedBuilder(this.compiler, Object.assign({}, this.parsedLayout, { asPartial: false }));
1996
- }
1997
- }
1998
-
1999
- export { ATTRS_BLOCK, Macros, LazyCompiler, compile, AbstractCompiler, debugCompiler, CompilableBlock, CompilableProgram, LazyOpcodeBuilder, EagerOpcodeBuilder, OpcodeBuilder, StdOpcodeBuilder, PartialDefinition, templateFactory, debug, debugSlice, logOpcode, WrappedBuilder, PLACEHOLDER_HANDLE };