Florian Bösch (2014-03-08T11:41:20.000Z)
On Fri, Mar 7, 2014 at 8:52 PM, Peter van der Zee <ecma at qfox.nl> wrote:

> I think you want to take a look at "source maps". They're specifically
> designed to deal with this problem.
>

The problem is that a function like compileShader would look like this:

var compileShader(source){
   var shader = gl.createShader(gl.VERTEX_SHADER);
   gl.shaderSource(shader, source);
   gl.compileShader(shader);
   if(!gl.getShaderParameter(GL_COMPILE_STATUS)){
     var error = glGetShaderInfoLog(shader);
     // now what?

     // need file of source

     // need lines # of source

   }
}

And you'd do things like:

var source = """
   void main(){
      #{someSnippet}
      gl_FragColor = whatever;
   }
"""
compileShader(source);

I don't see how source maps help either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140308/33e944f3/attachment.html>
domenic at domenicdenicola.com (2014-03-20T16:23:07.794Z)
On Fri, Mar 7, 2014 at 8:52 PM, Peter van der Zee <ecma at qfox.nl> wrote:

> I think you want to take a look at "source maps". They're specifically
> designed to deal with this problem.
>

The problem is that a function like compileShader would look like this:

```js
var compileShader(source){
   var shader = gl.createShader(gl.VERTEX_SHADER);
   gl.shaderSource(shader, source);
   gl.compileShader(shader);
   if(!gl.getShaderParameter(GL_COMPILE_STATUS)){
     var error = glGetShaderInfoLog(shader);
     // now what?

     // need file of source

     // need lines # of source

   }
}
```

And you'd do things like:

```
var source = """
   void main(){
      #{someSnippet}
      gl_FragColor = whatever;
   }
"""
compileShader(source);
```

I don't see how source maps help either.