Mixing simplemode and javascript mode possible?

I created a custom mode using CodeMirror.defineSimpleMode which works great. But is there a way to mix this custom mode with javascript mode?

I have tried setting mode as follows but it does not work:
mode : [{name: “mymode”}, {name: “javascript”}]

Look at the multiplex and overlay addons. Those are designed to combine multiple modes in a convenient way.