Skip to content

Runtime __DIR__/__FILE__ on include stack (#707)#710

Closed
PurHur wants to merge 2 commits into
masterfrom
issue-707-magic-dir-file-runtime
Closed

Runtime __DIR__/__FILE__ on include stack (#707)#710
PurHur wants to merge 2 commits into
masterfrom
issue-707-magic-dir-file-runtime

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 22, 2026

Summary

Test plan

  • ./script/docker-ci-local.sh fast --filter 'IncludeLiteralTest|CapabilitySyntaxTest'
  • VM: nested include reports helper basename for __DIR__ / __FILE__
  • Compile-time fold for relative entry paths (testCompileFoldsLiteralIncludeForRelativeScriptPath)

Closes #707. Related: #85, #706.

Made with Cursor

PurHur and others added 2 commits May 22, 2026 22:51
…).

Defer __DIR__ and __FILE__ to VM/JIT opcodes backed by a script path stack,
normalize compile paths for relative CLI scripts, and fold literal includes
when the including file is known. Closes the gap for MiniWebApp template paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use write slots for __DIR__/__FILE__ sentinel operands so Router and
other user methods do not treat them as unresolved call arguments.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
Copy link
Copy Markdown
Owner Author

PurHur commented May 22, 2026

Superseded by #709 (already merged to master with TYPE_SCRIPT_MAGIC + ScriptStack). Closing as duplicate.

@PurHur PurHur closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language: VM/JIT runtime __DIR__/__FILE__ on include stack (#85)

1 participant