It sounds to me like a good thing
This sounds to me like it could lead to a very good thing, and that is making the code more modular. Why should the scripting interpreter be so tightly coupled in the code? Define the interface between the rendering system's DOM and the scripting engine's event interface, and let both sides work in terms of that interface - pick the Javascript engine (or indeed whatever other scripting language you want), plug the interfaces together, and go.