make readonly dev-only

pull/9739/head
Rich Harris 3 years ago
parent 9c937e6b3a
commit 6539ad09da

@ -769,7 +769,9 @@ function serialize_inline_component(node, component_name, context) {
if (attribute.metadata.dynamic) {
// TODO create readonly deriveds outside the getters
push_prop(b.get(attribute.name, [b.return(b.call('$.readonly', value))]));
let arg = value;
if (context.state.options.dev) arg = b.call('$.readonly', arg);
push_prop(b.get(attribute.name, [b.return(arg)]));
} else {
push_prop(b.init(attribute.name, value));
}

@ -3,6 +3,10 @@ import { test } from '../../test';
export default test({
html: `<button>clicks: 0</button>`,
compileOptions: {
dev: true
},
async test({ assert, target }) {
const btn = target.querySelector('button');
await btn?.click();

Loading…
Cancel
Save