use IE-compatible js to check for unknown prop warnings (#3914)

pull/3915/head
Conduitry 6 years ago
parent c29e2085a1
commit 8c40d69d88

@ -247,7 +247,7 @@ export default function dom(
function create_fragment(#ctx) {
${block.get_contents()}
}
`);
`);
}
body.push(b`
@ -369,7 +369,7 @@ export default function dom(
unknown_props_check = b`
const writable_props = [${writable_props.map(prop => x`'${prop.export_name}'`)}];
@_Object.keys($$props).forEach(key => {
if (!writable_props.includes(key) && !key.startsWith('$$')) @_console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`);
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$') @_console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`);
});
`;
}

Loading…
Cancel
Save