|
|
|
|
@ -11,7 +11,6 @@ const readonly = new Set(['fullscreenElement', 'visibilityState']);
|
|
|
|
|
|
|
|
|
|
/** @extends Wrapper */
|
|
|
|
|
export default class DocumentWrapper extends Wrapper {
|
|
|
|
|
|
|
|
|
|
/** @type {import('../../nodes/Document.js').default} */
|
|
|
|
|
node;
|
|
|
|
|
|
|
|
|
|
@ -47,7 +46,8 @@ export default class DocumentWrapper extends Wrapper {
|
|
|
|
|
add_actions(block, x`@_document`, this.node.actions);
|
|
|
|
|
this.node.bindings.forEach((binding) => {
|
|
|
|
|
// TODO: what if it's a MemberExpression?
|
|
|
|
|
const binding_name = ( /** @type {import('estree').Identifier} */(binding.expression.node)).name;
|
|
|
|
|
const binding_name = /** @type {import('estree').Identifier} */ (binding.expression.node)
|
|
|
|
|
.name;
|
|
|
|
|
// in dev mode, throw if read-only values are written to
|
|
|
|
|
if (readonly.has(binding.name)) {
|
|
|
|
|
renderer.readonly.add(binding_name);
|
|
|
|
|
@ -56,8 +56,7 @@ export default class DocumentWrapper extends Wrapper {
|
|
|
|
|
const binding_events = associated_events[binding.name];
|
|
|
|
|
const property = binding.name;
|
|
|
|
|
binding_events.forEach((associated_event) => {
|
|
|
|
|
if (!events[associated_event])
|
|
|
|
|
events[associated_event] = [];
|
|
|
|
|
if (!events[associated_event]) events[associated_event] = [];
|
|
|
|
|
events[associated_event].push({
|
|
|
|
|
name: binding_name,
|
|
|
|
|
value: property
|
|
|
|
|
@ -87,7 +86,3 @@ export default class DocumentWrapper extends Wrapper {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|