Skip to content

Commit

Permalink
Fix readability
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Oct 23, 2023
1 parent 0ee25e3 commit f352a92
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 62 deletions.
3 changes: 2 additions & 1 deletion packages/babel/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ let bar = $signal('bar')
const example = {
foo: $property(foo),
'test': $property(bar),
bar: $property(bar),
baz: baz,
};
$(console.log(example.foo, example.bar));
Expand Down
2 changes: 1 addition & 1 deletion packages/babel/src/core/deref-memo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function derefMemo(
return;
}
const trueCallee = unwrapNode(p.node.callee, t.isIdentifier);
if (!trueCallee || p.scope.hasBinding(trueCallee.name) || !CALL_CTF.has(trueCallee.name)) {
if (!trueCallee || !CALL_CTF.has(trueCallee.name)) {
return;
}
const rawArgs = p.node.arguments[0];
Expand Down
1 change: 0 additions & 1 deletion packages/babel/src/core/deref-signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export default function derefSignal(
const trueCallee = unwrapNode(trueCallExpr.callee, t.isIdentifier);
if (
!trueCallee
|| p.scope.hasBinding(trueCallee.name)
|| !OBJECT_PROPERTY_CTF.has(trueCallee.name)
) {
return;
Expand Down
6 changes: 3 additions & 3 deletions packages/babel/src/core/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ function getNamespacedKey(
switch (identifier.type) {
case 'StringLiteral':
case 'NumericLiteral':
return t.stringLiteral(`${ROOT_SYMBOL}${name}$${identifier.value}`);
return t.stringLiteral(`${ROOT_SYMBOL}${name}__${identifier.value}`);
case 'Identifier':
return t.identifier(`${ROOT_SYMBOL}${name}$${identifier.name}`);
return t.identifier(`${ROOT_SYMBOL}${name}__${identifier.name}`);
case 'NullLiteral':
return t.identifier(`${ROOT_SYMBOL}${name}$null`);
return t.identifier(`${ROOT_SYMBOL}${name}__null`);
default:
return undefined;
}
Expand Down
Loading

0 comments on commit f352a92

Please sign in to comment.