any -> $$any

pull/3349/head
Maxim Matyunin 6 years ago
parent 73321465c1
commit 0b9928476f

@ -17,7 +17,7 @@ export default class EventHandler extends Node {
constructor(component: Component, parent, template_scope, info) {
super(component, parent, template_scope, info);
this.name = info.name !== '*' ? info.name : 'any';
this.name = info.name !== '*' ? info.name : '$$any';
this.modifiers = new Set(info.modifiers);
if (info.expression) {
@ -50,11 +50,13 @@ export default class EventHandler extends Node {
referenced: true
});
if (this.name !== '$$any') {
component.partly_hoisted.push(deindent`
function ${name}(event) {
@bubble($$self, event);
}
`);
}
this.handler_name = name;
}

@ -21,7 +21,7 @@ export default function add_event_handlers(
block.event_listeners.push(
`@listen(${target}, "${handler.name}", ${snippet}, ${opts_string})`
);
} else if (handler.name === 'any') {
} else if (handler.name === '$$any') {
block.any_event_elements.push(target);
// This isn't required but listen is treeshaken otherwise
block.event_listeners.push(

Loading…
Cancel
Save