I'm constructing two JS object in Dart. In JS, they are constructed with Object.create():
var wavesurfer1 = Object.create(WaveSurfer);
var wavesurfer2 = Object.create(WaveSurfer);
This is what I think is Dart equivalent:
var wavesurfer1 = context['WaveSurfer'];
var wavesurfer1 = context['WaveSurfer'];
But, I found that the two objects in Dart appear to be the same. When I call a function in one object it gets triggered in both. This does not happen in the JS code. I suspect that Object.create() should not be written as context[''] in Dart. If this is true, I'm not able to find an example in dartlang.org or stackoverflow.com for how to correctly translate this expression to Dart. You can see the JS source code for WaveSurfer here.