Merged
Conversation
add : max_bars_back (no-op in this implementation) Fix : user functions treated as native functions
….ts) for-loop update expression — was missing addArrayAccess(), MemberExpression, and CallExpression handlers. Caused infinite loops when Series variables (e.g. bar_index) appeared in for i = 0 to bar_index - X bounds — the update ternary used raw Series objects → NaN → always decremented. for-loop init expression — same missing addArrayAccess(). Caused for i = bar_index to 0 to assign a raw Series to i instead of the integer value → loop body never executed. while-loop test condition — missing addArrayAccess() and namespace object check. Caused while bar_index > cnt to compare raw Series → NaN → while body never executed. 2. Transpiler: Function-scoped variable resolution (ScopeManager.ts + ExpressionTransformer.ts) Added isVariableInFunctionScope() to walk the scope stack and detect variables in nested scopes (if/else/for) inside functions. createScopedVariableReference() now uses this to correctly resolve var inside if inside functions to local context ($$) instead of global ($). 3. Transpiler: Optional chaining for na UDT drawing fields (ExpressionTransformer.ts) Added hasGetCallInChain() helper that traverses MemberExpression AND intermediate CallExpression nodes. Inserts ?. on method calls through $.get() field chains, preventing crashes when UDT drawing fields (box/line/label) are na/undefined. Positioned AFTER argument transformation to avoid breaking $.get() wrapping. 4. Transpiler: User function vs method call disambiguation (ExpressionTransformer.ts) Added isChainedPropertyMethod guard — when callee object is a MemberExpression (e.g. aZZ.x.set()), skip user function transformation even if set is a user-defined function name. Added _skipTransformation = true on function reference identifiers in $.call() to prevent them being resolved to same-named variables. 5. Runtime: linefill.new thunking + instance methods (settings.ts, LinefillHelper.ts, LinefillObject.ts) Added linefill.new to FACTORY_METHODS so it gets thunk-wrapped in var declarations. LinefillHelper.new() now resolves line argument thunks before creating the object. Added get_line1(), get_line2(), set_color() instance methods on LinefillObject for UDT field access patterns. 6. Runtime: alert() + UDT named args (Core.ts, Context.class.ts, settings.ts) Added alert() stub (was missing, only alertcondition existed). UDT .new() now detects named argument objects so MyType.new(field1=val1, field2=val2) works correctly. 7. Transpiler: ReturnStatement walk-through (MainTransformer.ts) ReturnStatement handler now walks into complex return arguments when not in function scope, preventing untransformed expressions in nested return statements. 8. Tests (udt-drawing-objects.test.ts) Added 6 new tests: uninitialized drawing field access (box/line/label), linefill instance methods, linefill UDT field chain operations.
…pt dynamic signatures Fix : Label colos and backgrounds
Fix : tupples destructuring
Fix : in_seconds method with undefined timeframe other fixes ArrayExpression function parameter scoping — Added isLocalSeriesVar check in ExpressionTransformer.ts so function parameters inside array args use raw identifiers (output) instead of wrong global scope ($.let.output). color.from_gradient NaN guard — Added null/NaN/undefined checks for all 5 arguments in PineColor.ts to return undefined (na) instead of producing #NANNANNAN hex strings. Switch tuple destructuring — Wrapped IIFE array returns in 2D ([[a,b,c]]) in AnalysisPass.ts so $.init() preserves tuples instead of treating them as time-series and taking only the last element. Duplicate red key — Removed duplicate red entry in PineColor.ts COLOR_CONSTANTS.
fixed array and matrix typed declarations
Update : normalized timeframes Fix : plot color change detection Fix: str.plit should return a pine array
Fix : user methods expressions
array safesize polyline fixes fix getter when used with NaN
…,N).method() and isChained for $.get(X,N).field.method()) with detailed comments explaining why it must not be broadened Added ChainExpression traversal to hasGetCallInChain() so it can see through already-wrapped nodes when checking deeper in the chain Fix : transpiler function scope property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.