hoist these

pull/1819/head
Rich Harris 6 years ago
parent da3a45c526
commit 10011a5142

@ -57,6 +57,22 @@ const a11yRequiredContent = new Set([
const invisibleElements = new Set(['meta', 'html', 'script', 'style']);
const validModifiers = new Set([
'preventDefault',
'stopPropagation',
'capture',
'once',
'passive'
]);
const passiveEvents = new Set([
'wheel',
'touchstart',
'touchmove',
'touchend',
'touchcancel'
]);
export default class Element extends Node {
type: 'Element';
name: string;
@ -568,22 +584,6 @@ export default class Element extends Node {
validateEventHandlers() {
const { component } = this;
const validModifiers = new Set([
'preventDefault',
'stopPropagation',
'capture',
'once',
'passive'
]);
const passiveEvents = new Set([
'wheel',
'touchstart',
'touchmove',
'touchend',
'touchcancel'
]);
this.handlers.forEach(handler => {
if (handler.modifiers.has('passive') && handler.modifiers.has('preventDefault')) {
component.error(handler, {

Loading…
Cancel
Save