Fixed incorrect deprecation warning (#4074)

This commit is contained in:
daxpedda 2024-08-13 19:19:08 +02:00 committed by GitHub
parent d813df7bc1
commit b012a75b44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 54 additions and 24 deletions

View File

@ -1,6 +1,18 @@
# `wasm-bindgen` Change Log
--------------------------------------------------------------------------------
## Unreleased
### Fixed
* Fixed linked modules emitting snippet files when not using `--split-linked-modules`.
[#4066](https://github.com/rustwasm/wasm-bindgen/pull/4066)
* Fixed incorrect deprecation warning when passing no parameter into `default()` (`init()`) or `initSync()`.
[#4074](https://github.com/rustwasm/wasm-bindgen/pull/4074)
--------------------------------------------------------------------------------
## [0.2.93](https://github.com/rustwasm/wasm-bindgen/compare/0.2.92...0.2.93)
Released 2024-08-13

View File

@ -870,10 +870,13 @@ impl<'a> Context<'a> {
if (wasm !== undefined) return wasm;
{init_stack_size}
if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
({{module{init_memory_arg}{init_stack_size_arg}}} = module)
else
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
if (typeof module !== 'undefined') {{
if (Object.getPrototypeOf(module) === Object.prototype) {{
({{module{init_memory_arg}{init_stack_size_arg}}} = module)
}} else {{
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
}}
}}
const imports = __wbg_get_imports();
@ -892,10 +895,13 @@ impl<'a> Context<'a> {
if (wasm !== undefined) return wasm;
{init_stack_size}
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
({{module_or_path{init_memory_arg}{init_stack_size_arg}}} = module_or_path)
else
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
if (typeof module_or_path !== 'undefined') {{
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {{
({{module_or_path{init_memory_arg}{init_stack_size_arg}}} = module_or_path)
}} else {{
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}}
}}
{default_module_path}
const imports = __wbg_get_imports();

View File

@ -336,10 +336,13 @@ async function __wbg_init(module_or_path) {
if (wasm !== undefined) return wasm;
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
({module_or_path} = module_or_path)
else
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
if (typeof module_or_path !== 'undefined') {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({module_or_path} = module_or_path)
} else {
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}
}
if (typeof module_or_path === 'undefined') {
module_or_path = new URL('default_module_path_target_web_bg.wasm', import.meta.url);
@ -371,10 +374,13 @@ fn default_module_path_target_no_modules() {
if (wasm !== undefined) return wasm;
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
({module_or_path} = module_or_path)
else
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
if (typeof module_or_path !== 'undefined') {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({module_or_path} = module_or_path)
} else {
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}
}
if (typeof module_or_path === 'undefined' && typeof script_src !== 'undefined') {
module_or_path = script_src.replace(/\\.js$/, '_bg.wasm');
@ -400,10 +406,13 @@ async function __wbg_init(module_or_path) {
if (wasm !== undefined) return wasm;
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
({module_or_path} = module_or_path)
else
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
if (typeof module_or_path !== 'undefined') {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({module_or_path} = module_or_path)
} else {
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}
}
const imports = __wbg_get_imports();",
@ -428,10 +437,13 @@ fn omit_default_module_path_target_no_modules() {
if (wasm !== undefined) return wasm;
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
({module_or_path} = module_or_path)
else
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
if (typeof module_or_path !== 'undefined') {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({module_or_path} = module_or_path)
} else {
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}
}
const imports = __wbg_get_imports();",