1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Resolve a nested if-block bug in ext/wasm/c-pp.c which caused output after a nested block to be unduly elided. Remove a kludge, added in the previous check-in, which worked around that bug.

FossilOrigin-Name: 7a026a4b24d57c1b0970923b972dd42c3f1bb5b282f908079075468b2e1bf601
This commit is contained in:
stephan
2023-01-27 02:21:16 +00:00
parent 0cd38cd2b9
commit 67bfea4ea6
4 changed files with 34 additions and 35 deletions

View File

@ -10,6 +10,7 @@ const sqlite3InitModuleState = self.sqlite3InitModuleState || Object.create(null
delete self.sqlite3InitModuleState;
sqlite3InitModuleState.debugModule('self.location =',self.location);
//#ifnot target=es6-bundler-friendly
/**
This custom locateFile() tries to figure out where to load `path`
from. The intent is to provide a way for foo/bar/X.js loaded from a
@ -29,12 +30,7 @@ sqlite3InitModuleState.debugModule('self.location =',self.location);
4) If none of the above apply, (prefix+path) is returned.
*/
Module['locateFile'] = function(path, prefix) {
//#if target=es6-bundler-friendly
// TEMPORARY KLUDGE to work around a c-pp nested blocks bug which is
// currently eluding a fix. We really should have (#ifnot
// target=es6-bundler-friendly) around this whole function.
return new URL('sqlite3.wasm', import.meta.url).href;
//#elif target=es6-module
//#if target=es6-module
return new URL(path, import.meta.url).href;
//#else
'use strict';
@ -58,6 +54,7 @@ Module['locateFile'] = function(path, prefix) {
return theFile;
//#endif //target=es6-module
}.bind(sqlite3InitModuleState);
//#endif //ifnot target=es6-bundler-friendly
/**
Bug warning: a custom Module.instantiateWasm() does not work
@ -107,4 +104,4 @@ Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
Module[xNameOfInstantiateWasm].uri = 'sqlite3.wasm';
/* END FILE: api/pre-js.js, noting that the build process may add a
line after this one to change the above .uri to a build-specific
one. *//* END FILE: api/pre-js.js */
one. */