plasma-umass / browsix

Browsix is a Unix-like operating system for the browser.
Other
3.14k stars 181 forks source link

Surprising behavior for commands in Unix shell #1

Open emeryberger opened 8 years ago

emeryberger commented 8 years ago
$ ls -ltra
/usr/bin/ls: [object Object]$ 
bpowers commented 8 years ago

A couple of issues here.

I've fixed the first 3 issues in 81a04c692 for ls, but this needs to be updated & standardized for all the commands.

bpowers commented 8 years ago

Going to leave this open as a tracking issue until all commands are fixed.

jvilk commented 8 years ago

Do the error objects not have a toString()? (And whose error objects are they?)

jvilk commented 8 years ago

(BrowserFS error objects have toString() defined to return error.message)

bpowers commented 8 years ago

@jvilk they start as BrowserFS errors, but when they are transferred to the Worker the prototype is stripped thanks to the structured cloning algorithm :\

Right before postMessage to worker: screenshot from 2016-02-22 13-21-27

After worker gets the message: screenshot from 2016-02-22 13-16-38

bpowers commented 8 years ago

I guess I should detect if we've received something like an ApiError and replace the received object with a new ApiError