Skip to content

Commit 7983522

Browse files
authored
Use JS naming convention for JS-only symbol. NFC (#21188)
The `emscripten_` naming convention is something we use for native function and this symbol is not visible to native code.
1 parent b64f144 commit 7983522

6 files changed

+11
-10
lines changed

src/library_html5_webgl.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ var LibraryHtml5WebGL = {
2020
return len;
2121
},
2222

23-
$emscripten_webgl_power_preferences: "['default', 'low-power', 'high-performance']",
23+
$webglPowerPreferences__internal: true,
24+
$webglPowerPreferences: ['default', 'low-power', 'high-performance'],
2425

2526
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
2627
// In offscreen framebuffer mode, we implement a proxied version of the
@@ -50,7 +51,7 @@ var LibraryHtml5WebGL = {
5051
#if PTHREADS && OFFSCREEN_FRAMEBUFFER
5152
'emscripten_webgl_create_context_proxied',
5253
#endif
53-
'$JSEvents', '$emscripten_webgl_power_preferences', '$findEventTarget', '$findCanvasEventTarget'],
54+
'$JSEvents', '$webglPowerPreferences', '$findEventTarget', '$findCanvasEventTarget'],
5455
// This function performs proxying manually, depending on the style of context that is to be created.
5556
emscripten_webgl_do_create_context: (target, attributes) => {
5657
#if ASSERTIONS
@@ -65,7 +66,7 @@ var LibraryHtml5WebGL = {
6566
'antialias': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.antialias }}}>>2)],
6667
'premultipliedAlpha': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha }}}>>2)],
6768
'preserveDrawingBuffer': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer }}}>>2)],
68-
'powerPreference': emscripten_webgl_power_preferences[powerPreference],
69+
'powerPreference': webglPowerPreferences[powerPreference],
6970
'failIfMajorPerformanceCaveat': !!HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat }}}>>2)],
7071
// The following are not predefined WebGL context attributes in the WebGL specification, so the property names can be minified by Closure.
7172
majorVersion: HEAP32[a + ({{{ C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion }}}>>2)],
@@ -252,7 +253,7 @@ var LibraryHtml5WebGL = {
252253
},
253254

254255
emscripten_webgl_get_context_attributes__proxy: 'sync_on_webgl_context_handle_thread',
255-
emscripten_webgl_get_context_attributes__deps: ['$emscripten_webgl_power_preferences'],
256+
emscripten_webgl_get_context_attributes__deps: ['$webglPowerPreferences'],
256257
emscripten_webgl_get_context_attributes: (c, a) => {
257258
if (!a) return {{{ cDefs.EMSCRIPTEN_RESULT_INVALID_PARAM }}};
258259
c = GL.contexts[c];
@@ -267,7 +268,7 @@ var LibraryHtml5WebGL = {
267268
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.antialias, 't.antialias', 'i32') }}};
268269
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.premultipliedAlpha, 't.premultipliedAlpha', 'i32') }}};
269270
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.preserveDrawingBuffer, 't.preserveDrawingBuffer', 'i32') }}};
270-
var power = t['powerPreference'] && emscripten_webgl_power_preferences.indexOf(t['powerPreference']);
271+
var power = t['powerPreference'] && webglPowerPreferences.indexOf(t['powerPreference']);
271272
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.powerPreference, 'power', 'i32') }}};
272273
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.failIfMajorPerformanceCaveat, 't.failIfMajorPerformanceCaveat', 'i32') }}};
273274
{{{ makeSetValue('a', C_STRUCTS.EmscriptenWebGLContextAttributes.majorVersion, 'c.version', 'i32') }}};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8408
1+
8390
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
23069
1+
23034
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7238
1+
7219
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19693
1+
19658
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
58237
1+
58197

0 commit comments

Comments
 (0)