NPellet / visualizer

Other
43 stars 24 forks source link

The jpath in the output variable shows all the element of the array #714

Open visualizer-feedback opened 9 years ago

visualizer-feedback commented 9 years ago

The jpath for an array is expected to display only the first 5 elements. However it seems that in the case of typed array all the elements are shown.

Testcase: http://visualizer.epfl.ch/tiny/OLkqR1hRYGgNU1mSY4nE (Original URL)

targos commented 9 years ago

I don't think this can be fixed. Objects passed between modules are transformed (especially their prototype) by the visualizer. If I make the necessary change to detect typed arrays as arrays, the array data is lost:

> var a = new Uint16Array(10);
> a
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
> a.__proto__ = DataArray.prototype
> a
[]
> a.length
0
lpatiny commented 9 years ago

I have the impression that the typedarray is converted to an object and the inspection is done on all the elements of the object. The problem here is not that we want to transfer a typedarray between modules but that we can not open the preference of a module because the creation of the drop down menu to select the jpath of the output variable crash the browser.

targos commented 9 years ago

I know it is converted to an object. But if I fix this, it will be converted to an array and lose the data...

targos commented 9 years ago

Typed Arrays cannot be serialized to JSON, that is the main issue here

targos commented 9 years ago

I have an idea on how to solve this. It requires to get rid of the DataObject approach, so it would be a quite big change :laughing:

NPellet commented 9 years ago

Since Chrome 36, the visualizer DataObject becomes useless

Object.observe should be able to transparently replace the previous implementation...

2015-09-26 12:42 GMT+02:00 Michaël Zasso notifications@github.com:

I have an idea on how to solve this. It requires to get rid of the DataObject approach, so it would be a quite big change [image: :laughing:]

— Reply to this email directly or view it on GitHub https://github.com/NPellet/visualizer/issues/714#issuecomment-143418635.

targos commented 8 years ago

Object.observe is dead: https://mail.mozilla.org/pipermail/es-discuss/2015-November/044684.html

NPellet commented 8 years ago

That's a stupid explanation...

2015-11-02 20:46 GMT+01:00 Michaël Zasso notifications@github.com:

Object.observe is dead: https://mail.mozilla.org/pipermail/es-discuss/2015-November/044684.html

— Reply to this email directly or view it on GitHub https://github.com/NPellet/visualizer/issues/714#issuecomment-153137273.