Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deconflict value parameter in contextual bindings #4452

Merged
merged 6 commits into from
Feb 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
deconflict 'value' param in contextual bindings (#4445)
Conduitry committed Feb 23, 2020
commit 400cd1d1eae01c7bd56d60c46a7fda178035783b
Original file line number Diff line number Diff line change
@@ -332,8 +332,7 @@ export default class InlineComponentWrapper extends Wrapper {
contextual_dependencies.push(object.name, property.name);
}

const value = block.get_unique_name('value');
const params: any[] = [value];
const params: any[] = [x`#value`];
if (contextual_dependencies.length > 0) {
const args = [];

@@ -349,23 +348,23 @@ export default class InlineComponentWrapper extends Wrapper {


block.chunks.init.push(b`
function ${id}(${value}) {
${callee}.call(null, ${value}, ${args});
function ${id}(#value) {
${callee}.call(null, #value, ${args});
}
`);

block.maintain_context = true; // TODO put this somewhere more logical
} else {
block.chunks.init.push(b`
function ${id}(${value}) {
${callee}.call(null, ${value});
function ${id}(#value) {
${callee}.call(null, #value);
}
`);
}

const body = b`
function ${id}(${params}) {
${lhs} = ${value};
${lhs} = #value;
${renderer.invalidate(dependencies[0])};
}
`;