File: test_override_system_js_lib_symbol.js

package info (click to toggle)
emscripten 3.1.69%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,872 kB
  • sloc: ansic: 636,110; cpp: 425,974; javascript: 78,401; python: 58,404; sh: 49,154; pascal: 5,237; makefile: 3,365; asm: 2,415; lisp: 1,869
file content (28 lines) | stat: -rw-r--r-- 937 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if (!LibraryManager.library.glTexImage3D) throw 'This file should be getting processed after library_webgl2.js!';

addToLibrary({
	orig_glTexImage3D__deps: LibraryManager.library.glTexImage3D__deps,
	orig_glTexImage3D: LibraryManager.library.glTexImage3D,

	glTexImage3D__deps: ['orig_glTexImage3D'],
	glTexImage3D: function(target, level, internalFormat, width, height, depth, border, format, type, pixels) {
		_glTexImage3D.createdType = type;
		// Check that the original fuction exists
		assert(_orig_glTexImage3D);
		// Also try invoking glTexImage3D to verify that it is actually the
		// underlying function from library_webgl2.js
		var texImage3D_called = false;
		// Mock GL context to be able to call from shell.
		GLctx = {
			texImage3D: function() {
				texImage3D_called = true;
			},
		};
		_orig_glTexImage3D();
		assert(texImage3D_called);
	},

	what_got_created: function() {
		return _glTexImage3D.createdType;
	}
});