@@ -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 = [
@@ -280,7 +280,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
280280 // glGetError() to fetch it. As per GLES2 spec, only the first error is
281281 // remembered, and subsequent errors are discarded until the user has
282282 // cleared the stored error by a call to glGetError().
283- recordError : function recordError ( errorCode ) {
283+ recordError : ( errorCode ) => {
284284#if GL_TRACK_ERRORS
285285 if ( ! GL . lastError ) {
286286 GL . lastError = errorCode ;
@@ -370,7 +370,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
370370 }
371371 } ,
372372
373- getTempVertexBuffer : function getTempVertexBuffer ( sizeBytes ) {
373+ getTempVertexBuffer : ( sizeBytes ) = > {
374374 var idx = GL . log2ceilLookup ( sizeBytes ) ;
375375 var ringbuffer = GL . currentContext . tempVertexBuffers1 [ idx ] ;
376376 var nextFreeBufferIndex = GL . currentContext . tempVertexBufferCounters1 [ idx ] ;
@@ -387,7 +387,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
387387 return ringbuffer [ nextFreeBufferIndex ] ;
388388 } ,
389389
390- getTempIndexBuffer : function getTempIndexBuffer ( sizeBytes ) {
390+ getTempIndexBuffer : ( sizeBytes ) => {
391391 var idx = GL . log2ceilLookup ( sizeBytes ) ;
392392 var ibo = GL . currentContext . tempIndexBuffers [ idx ] ;
393393 if ( ibo ) {
@@ -405,7 +405,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
405405 // doublebuffered temp VB memory pointers, so that every second frame
406406 // utilizes different set of temp buffers. The aim is to keep the set of
407407 // buffers being rendered, and the set of buffers being updated disjoint.
408- newRenderingFrameStarted : function newRenderingFrameStarted ( ) {
408+ newRenderingFrameStarted : ( ) = > {
409409 if ( ! GL . currentContext ) {
410410 return ;
411411 }
@@ -450,13 +450,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
450450
451451#if GL_FFP_ONLY
452452 enabledClientAttribIndices : [ ] ,
453- enableVertexAttribArray : function enableVertexAttribArray ( index ) {
453+ enableVertexAttribArray : ( index ) = > {
454454 if ( ! GL . enabledClientAttribIndices [ index ] ) {
455455 GL . enabledClientAttribIndices [ index ] = true ;
456456 GLctx . enableVertexAttribArray ( index ) ;
457457 }
458458 } ,
459- disableVertexAttribArray : function disableVertexAttribArray ( index ) {
459+ disableVertexAttribArray : ( index ) => {
460460 if ( GL . enabledClientAttribIndices [ index ] ) {
461461 GL . enabledClientAttribIndices [ index ] = false ;
462462 GLctx . disableVertexAttribArray ( index ) ;
@@ -465,7 +465,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
465465#endif
466466
467467#if FULL_ES2
468- calcBufLength : function calcBufLength ( size , type , stride , count ) {
468+ calcBufLength : ( size , type , stride , count ) => {
469469 if ( stride > 0 ) {
470470 return count * stride ; // XXXvlad this is not exactly correct I don't think
471471 }
@@ -475,7 +475,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
475475
476476 usedTempBuffers : [ ] ,
477477
478- preDrawHandleClientVertexAttribBindings : function preDrawHandleClientVertexAttribBindings ( count ) {
478+ preDrawHandleClientVertexAttribBindings : ( count ) = > {
479479 GL . resetBufferBinding = false ;
480480
481481 // TODO: initial pass to detect ranges we need to upload, might not need
@@ -499,7 +499,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
499499 }
500500 } ,
501501
502- postDrawHandleClientVertexAttribBindings : function postDrawHandleClientVertexAttribBindings ( ) {
502+ postDrawHandleClientVertexAttribBindings : ( ) = > {
503503 if ( GL . resetBufferBinding ) {
504504 GLctx . bindBuffer ( 0x8892 /*GL_ARRAY_BUFFER*/ , GL . buffers [ GLctx . currentArrayBufferBinding ] ) ;
505505 }
@@ -3673,7 +3673,7 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
36733673 , '$emulGlGenVertexArrays'
36743674#endif
36753675 ] ,
3676- glGenVertexArrays : function ( n , arrays ) {
3676+ glGenVertexArrays : ( n , arrays ) = > {
36773677#if LEGACY_GL_EMULATION
36783678 emulGlGenVertexArrays ( n , arrays ) ;
36793679#else
@@ -4204,13 +4204,13 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
42044204 'SDL_GL_GetProcAddress' ,
42054205 'eglGetProcAddress' ,
42064206 'glfwGetProcAddress'
4207- ] . forEach ( function ( name ) {
4208- LibraryGL [ name ] = function ( name ) { abort ( ) ; return 0 ; } ;
4207+ ] . forEach ( ( name ) => {
4208+ LibraryGL [ name ] = ( name ) => { abort ( ) ; return 0 ; } ;
42094209 // Due to the two pass nature of compiling .js files,
42104210 // in INCLUDE_FULL_LIBRARY mode, we must include the above
42114211 // stub functions, but not their __deps message handlers.
42124212#if ! INCLUDE_FULL_LIBRARY
4213- LibraryGL [ name + '__deps' ] = [ function ( ) {
4213+ LibraryGL [ name + '__deps' ] = [ ( ) => {
42144214 error ( `linker: Undefined symbol: ${ name } (). Please pass -sGL_ENABLE_GET_PROC_ADDRESS at link time to link in ${ name } ().` ) ;
42154215 } ] ;
42164216#endif
@@ -4235,15 +4235,12 @@ function createGLPassthroughFunctions(lib, funcs) {
42354235 const num = data [ 0 ] ;
42364236 const names = data [ 1 ] ;
42374237 const args = range ( num ) . map ( ( i ) => 'x' + i ) . join ( ', ' ) ;
4238- const plainStub = `(function(${ args } ) { GLctx.NAME(${ args } ) })` ;
4239- const returnStub = `(function(${ args } ) { return GLctx.NAME(${ args } ) })` ;
4238+ const stub = `(${ args } ) => GLctx.NAME(${ args } )` ;
42404239 const sigEnd = range ( num ) . map ( ( ) => 'i' ) . join ( '' ) ;
42414240 names . split ( ' ' ) . forEach ( ( name ) => {
4242- let stub = plainStub ;
42434241 let sig ;
42444242 if ( name . endsWith ( '*' ) ) {
42454243 name = name . slice ( 0 , - 1 ) ;
4246- stub = returnStub ;
42474244 sig = 'i' + sigEnd ;
42484245 } else {
42494246 sig = 'v' + sigEnd ;
0 commit comments