juxscript 1.1.279 → 1.1.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/machinery/autowrap.js +6 -6
- package/package.json +1 -1
package/machinery/autowrap.js
CHANGED
|
@@ -70,19 +70,19 @@ function isAlreadyWrapped(stmt) {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function isSetupStatement(stmt) {
|
|
73
|
+
// Never treat statements referencing pageState as setup
|
|
74
|
+
if (containsPageStateRef(stmt)) return false;
|
|
75
|
+
|
|
73
76
|
if (stmt.type === 'ImportDeclaration') return true;
|
|
74
77
|
if (stmt.type === 'FunctionDeclaration') return true;
|
|
75
78
|
if (stmt.type === 'ExpressionStatement') {
|
|
76
79
|
const expr = stmt.expression;
|
|
77
80
|
if (expr.type === 'CallExpression' &&
|
|
78
|
-
expr.callee?.object?.name === 'jux'
|
|
79
|
-
!containsPageStateRef(stmt)) return true;
|
|
81
|
+
expr.callee?.object?.name === 'jux') return true;
|
|
80
82
|
if (expr.type === 'AwaitExpression' &&
|
|
81
|
-
expr.argument?.callee?.object?.name === 'jux'
|
|
82
|
-
!containsPageStateRef(stmt)) return true;
|
|
83
|
+
expr.argument?.callee?.object?.name === 'jux') return true;
|
|
83
84
|
}
|
|
84
|
-
if (stmt.type === 'VariableDeclaration'
|
|
85
|
-
if (stmt.type === 'VariableDeclaration' && containsJuxCall(stmt) && !containsPageStateRef(stmt)) return true;
|
|
85
|
+
if (stmt.type === 'VariableDeclaration') return true;
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
|