@@ -4317,9 +4317,7 @@ var glPassthroughFuncs = [
4317
4317
] ;
4318
4318
4319
4319
function createGLPassthroughFunctions ( lib , funcs ) {
4320
- funcs . forEach ( ( data ) => {
4321
- const num = data [ 0 ] ;
4322
- const names = data [ 1 ] ;
4320
+ for ( const [ num , names ] of funcs ) {
4323
4321
const args = range ( num ) . map ( ( i ) => 'x' + i ) . join ( ', ' ) ;
4324
4322
const stub = `(${ args } ) => GLctx.NAME(${ args } )` ;
4325
4323
const sigEnd = range ( num ) . map ( ( ) => 'i' ) . join ( '' ) ;
@@ -4341,7 +4339,7 @@ function createGLPassthroughFunctions(lib, funcs) {
4341
4339
lib [ cName ] = eval ( stub . replace ( 'NAME' , name ) ) ;
4342
4340
assert ( lib [ cName + '__sig' ] || LibraryManager . library [ cName + '__sig' ] , 'missing sig for ' + cName ) ;
4343
4341
} ) ;
4344
- } ) ;
4342
+ }
4345
4343
}
4346
4344
4347
4345
createGLPassthroughFunctions ( LibraryGL , glPassthroughFuncs ) ;
@@ -4352,15 +4350,16 @@ function recordGLProcAddressGet(lib) {
4352
4350
// GL proc address retrieval - allow access through glX and emscripten_glX, to
4353
4351
// allow name collisions with user-implemented things having the same name
4354
4352
// (see gl.c)
4355
- Object . keys ( lib ) . forEach ( ( x ) => {
4356
- if ( x . startsWith ( 'gl' ) && ! isDecorator ( x ) ) {
4357
- lib [ 'emscripten_' + x ] = x ;
4358
- var sig = LibraryManager . library [ x + '__sig' ] ;
4353
+ for ( const sym of Object . keys ( lib ) ) {
4354
+ if ( sym . startsWith ( 'gl' ) && ! isDecorator ( sym ) ) {
4355
+ const alias = 'emscripten_' + sym ;
4356
+ lib [ alias ] = sym ;
4357
+ var sig = LibraryManager . library [ sym + '__sig' ] ;
4359
4358
if ( sig ) {
4360
- lib [ 'emscripten_' + x + '__sig' ] = sig ;
4359
+ lib [ alias + '__sig' ] = sig ;
4361
4360
}
4362
4361
}
4363
- } ) ;
4362
+ }
4364
4363
}
4365
4364
4366
4365
recordGLProcAddressGet ( LibraryGL ) ;
0 commit comments