Skip to content

Provide ScriptEngine.FILENAME for @JavaScriptResource#59

Open
jtulach wants to merge 2 commits into
apache:masterfrom
jtulach:ScriptFileName
Open

Provide ScriptEngine.FILENAME for @JavaScriptResource#59
jtulach wants to merge 2 commits into
apache:masterfrom
jtulach:ScriptFileName

Conversation

@jtulach
Copy link
Copy Markdown
Contributor

@jtulach jtulach commented May 19, 2026

  • Debugging of @JavaScriptResource when ScriptPresenter is used was not easy.
  • when the JavaScript code is ScriptEngine.evaluated
    • it doesn't have proper file associated
  • this PR fixes that by tunneling URL of the resource to ScriptPresenter
  • and using it as ScriptEngine.FILENAME
    • when the URL represents a file on disk
    • it does represent it when running unit tests in Maven environment

@jtulach jtulach requested review from entlicher and lahodaj May 19, 2026 06:23
@jtulach jtulach self-assigned this May 19, 2026
@jtulach jtulach requested a review from eppleton May 19, 2026 06:27
@jtulach
Copy link
Copy Markdown
Contributor Author

jtulach commented May 19, 2026

  • This is the result of debugging the new ScriptEngineEvalTest in NetBeans 30:
throw.js
  • the name of the file is really yield.js as is the name of the file on disk
    • alas, it is not the source file, but its copy in target resources...
  • the stack trace rally contains throws.js:21 as verified by assertStackContains in the test

@jtulach jtulach requested a review from sdedic May 19, 2026 06:47
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.

1 participant