Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 68e650a

Browse files
workaround for latests JS script engine which cannot evaluate the toString() method for dynamically created class
1 parent 85014bc commit 68e650a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sqlcl/format.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,12 @@ var unregisterTvdFormat = function () {
759759
.stream().map(function(l) {return l.getClass()}).collect(javaCollectors.toSet());
760760
// re-register all commands except for class TvdFormat and remaining (not removed) listener classes
761761
for (var i in listeners) {
762-
if (listeners.get(i).toString() !== "TvdFormat" && !remainingListeners.contains(listeners.get(i).getClass())) {
763-
javaCommandRegistry.addForAllStmtsListener(listeners.get(i).getClass());
762+
try {
763+
if (listeners.get(i).toString() !== "TvdFormat" && !remainingListeners.contains(listeners.get(i).getClass())) {
764+
javaCommandRegistry.addForAllStmtsListener(listeners.get(i).getClass());
765+
}
766+
} catch (e) {
767+
// ignore, assume toString() cannot be evaluated and therefore a class that does not need to be registered.
764768
}
765769
}
766770
}

0 commit comments

Comments
 (0)