@@ -136,7 +136,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
136136 emscripten_webgl_enable_WEBGL_multi_draw : ( ctx ) => webgl_enable_WEBGL_multi_draw ( GL . contexts [ ctx ] . GLctx ) ,
137137
138138 $getEmscriptenSupportedExtensions__internal : true ,
139- $getEmscriptenSupportedExtensions : function ( ctx ) {
139+ $getEmscriptenSupportedExtensions : ( ctx ) => {
140140 // Restrict the list of advertised extensions to those that we actually
141141 // support.
142142 var supportedExtensions = [
@@ -287,7 +287,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
287287 // glGetError() to fetch it. As per GLES2 spec, only the first error is
288288 // remembered, and subsequent errors are discarded until the user has
289289 // cleared the stored error by a call to glGetError().
290- recordError : function recordError ( errorCode ) {
290+ recordError : ( errorCode ) => {
291291#if GL_TRACK_ERRORS
292292 if ( ! GL . lastError ) {
293293 GL . lastError = errorCode ;
@@ -377,7 +377,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
377377 }
378378 } ,
379379
380- getTempVertexBuffer : function getTempVertexBuffer ( sizeBytes ) {
380+ getTempVertexBuffer : ( sizeBytes ) = > {
381381 var idx = GL . log2ceilLookup ( sizeBytes ) ;
382382 var ringbuffer = GL . currentContext . tempVertexBuffers1 [ idx ] ;
383383 var nextFreeBufferIndex = GL . currentContext . tempVertexBufferCounters1 [ idx ] ;
@@ -394,7 +394,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
394394 return ringbuffer [ nextFreeBufferIndex ] ;
395395 } ,
396396
397- getTempIndexBuffer : function getTempIndexBuffer ( sizeBytes ) {
397+ getTempIndexBuffer : ( sizeBytes ) => {
398398 var idx = GL . log2ceilLookup ( sizeBytes ) ;
399399 var ibo = GL . currentContext . tempIndexBuffers [ idx ] ;
400400 if ( ibo ) {
@@ -412,7 +412,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
412412 // doublebuffered temp VB memory pointers, so that every second frame
413413 // utilizes different set of temp buffers. The aim is to keep the set of
414414 // buffers being rendered, and the set of buffers being updated disjoint.
415- newRenderingFrameStarted : function newRenderingFrameStarted ( ) {
415+ newRenderingFrameStarted : ( ) = > {
416416 if ( ! GL . currentContext ) {
417417 return ;
418418 }
@@ -457,13 +457,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
457457
458458#if GL_FFP_ONLY
459459 enabledClientAttribIndices : [ ] ,
460- enableVertexAttribArray : function enableVertexAttribArray ( index ) {
460+ enableVertexAttribArray : ( index ) = > {
461461 if ( ! GL . enabledClientAttribIndices [ index ] ) {
462462 GL . enabledClientAttribIndices [ index ] = true ;
463463 GLctx . enableVertexAttribArray ( index ) ;
464464 }
465465 } ,
466- disableVertexAttribArray : function disableVertexAttribArray ( index ) {
466+ disableVertexAttribArray : ( index ) => {
467467 if ( GL . enabledClientAttribIndices [ index ] ) {
468468 GL . enabledClientAttribIndices [ index ] = false ;
469469 GLctx . disableVertexAttribArray ( index ) ;
@@ -472,7 +472,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
472472#endif
473473
474474#if FULL_ES2
475- calcBufLength : function calcBufLength ( size , type , stride , count ) {
475+ calcBufLength : ( size , type , stride , count ) => {
476476 if ( stride > 0 ) {
477477 return count * stride ; // XXXvlad this is not exactly correct I don't think
478478 }
@@ -482,7 +482,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
482482
483483 usedTempBuffers : [ ] ,
484484
485- preDrawHandleClientVertexAttribBindings : function preDrawHandleClientVertexAttribBindings ( count ) {
485+ preDrawHandleClientVertexAttribBindings : ( count ) = > {
486486 GL . resetBufferBinding = false ;
487487
488488 // TODO: initial pass to detect ranges we need to upload, might not need
@@ -506,7 +506,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
506506 }
507507 } ,
508508
509- postDrawHandleClientVertexAttribBindings : function postDrawHandleClientVertexAttribBindings ( ) {
509+ postDrawHandleClientVertexAttribBindings : ( ) = > {
510510 if ( GL . resetBufferBinding ) {
511511 GLctx . bindBuffer ( 0x8892 /*GL_ARRAY_BUFFER*/ , GL . buffers [ GLctx . currentArrayBufferBinding ] ) ;
512512 }
@@ -3680,7 +3680,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
36803680 , '$emulGlGenVertexArrays'
36813681#endif
36823682 ] ,
3683- glGenVertexArrays : function ( n , arrays ) {
3683+ glGenVertexArrays : ( n , arrays ) = > {
36843684#if LEGACY_GL_EMULATION
36853685 emulGlGenVertexArrays ( n , arrays ) ;
36863686#else
@@ -4211,13 +4211,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
42114211 'SDL_GL_GetProcAddress' ,
42124212 'eglGetProcAddress' ,
42134213 'glfwGetProcAddress'
4214- ] . forEach ( function ( name ) {
4215- LibraryGL [ name ] = function ( name ) { abort ( ) ; return 0 ; } ;
4214+ ] . forEach ( ( name ) => {
4215+ LibraryGL [ name ] = ( name ) => { abort ( ) ; return 0 ; } ;
42164216 // Due to the two pass nature of compiling .js files,
42174217 // in INCLUDE_FULL_LIBRARY mode, we must include the above
42184218 // stub functions, but not their __deps message handlers.
42194219#if ! INCLUDE_FULL_LIBRARY
4220- LibraryGL [ name + '__deps' ] = [ function ( ) {
4220+ LibraryGL [ name + '__deps' ] = [ ( ) => {
42214221 error ( `linker: Undefined symbol: ${ name } (). Please pass -sGL_ENABLE_GET_PROC_ADDRESS at link time to link in ${ name } ().` ) ;
42224222 } ] ;
42234223#endif
@@ -4242,15 +4242,12 @@ function createGLPassthroughFunctions(lib, funcs) {
42424242 const num = data [ 0 ] ;
42434243 const names = data [ 1 ] ;
42444244 const args = range ( num ) . map ( ( i ) => 'x' + i ) . join ( ', ' ) ;
4245- const plainStub = `(function(${ args } ) { GLctx.NAME(${ args } ) })` ;
4246- const returnStub = `(function(${ args } ) { return GLctx.NAME(${ args } ) })` ;
4245+ const stub = `(${ args } ) => GLctx.NAME(${ args } )` ;
42474246 const sigEnd = range ( num ) . map ( ( ) => 'i' ) . join ( '' ) ;
42484247 names . split ( ' ' ) . forEach ( ( name ) => {
4249- let stub = plainStub ;
42504248 let sig ;
42514249 if ( name . endsWith ( '*' ) ) {
42524250 name = name . slice ( 0 , - 1 ) ;
4253- stub = returnStub ;
42544251 sig = 'i' + sigEnd ;
42554252 } else {
42564253 sig = 'v' + sigEnd ;
0 commit comments