Commit 69317b2
committed
DefaultScriptService: fix null context bug
For languages created simply by wrapping an existing ScriptEngineFactory
from the ScriptEngineManager, no context was ever being injected into
the wrapped ScriptLanguage. The ScriptLanguage plugin type extends
RichPlugin, which means every plugin instance is supposed to have a
non-null context. Hence, this behavior should be considered a bug.
Since the ScriptLanguageIndex is context-free, it does not know the
context to inject it. So to fix this problem in the least invasive way,
we simply have the ScriptService walk the whole list of available
ScriptLanguages after initially populating them, injecting the context
into any language for which it is still null.1 parent eb76527 commit 69317b2
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
| |||
0 commit comments