scijs/cwise

bug with Safari ?

mattdesl opened this issue · 3 comments

I'm trying to track down a nasty bug with Safari which I think is related to cwise. The trouble is, it only crops up when uglify is set to compress mode. And the Safari debugger sucks, so there is a chance it's giving me a totally wrong line number in the minified bundle (i.e. might lie in a different module). Gonna try to get source maps working to figure this out.

Can be reproduced with:
http://mattdesl.github.io/frontend-npm-goodies/dist/webgl-bunny.html

Weird... The page won't even load in safari for me.

It could be writing past the end of a typed array maybe? That can happen if you pass in views that are out of bounds.

If the problem is happening with uglify, then the issue is probably that uglify is doing something crazy which is breaking stuff.

Did you try using cwise as a browserify transform? That might solve the problem since it inlines/compresses all your cwise functions (and will also save you the weight of brining in the esprima dependency).

Check the console in Safari, page breaks because of an error.

Will test out the transform approach

Sent from my iPhone

On Nov 10, 2014, at 10:27 AM, Mikola Lysenko notifications@github.com wrote:

Weird... The page won't even load in safari for me.

It could be writing past the end of a typed array maybe? That can happen if you pass in views that are out of bounds.

If the problem is happening with uglify, then the issue is probably that uglify is doing something crazy which is breaking stuff.

Did you try using cwise as a browserify transform? That might solve the problem since it inlines/compresses all your cwise functions (and will also save you the weight of brining in the esprima dependency).


Reply to this email directly or view it on GitHub.

I've boiled it down to this. Safari with UglifyJS Mangle + Compressor breaks it. Will keep poking around...

var bunny = require('bunny')
var createGeometry = require('gl-geometry')
var gl = require('webgl-context')()
createGeometry(gl).attr('position', bunny.positions)

EDIT: it's due to @Benvie's weak map.