@silvia-odwyer%2Fphoton-node@0.3.4.patch 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. diff --git a/photon_rs.js b/photon_rs.js
  2. index 8f4144d..29a964a 100644
  3. --- a/photon_rs.js
  4. +++ b/photon_rs.js
  5. @@ -1,6 +1,7 @@
  6. let imports = {};
  7. -imports['__wbindgen_placeholder__'] = module.exports;
  8. +const __wbindgen_placeholder__ = {};
  9. +imports['__wbindgen_placeholder__'] = __wbindgen_placeholder__;
  10. let wasm;
  11. const { TextEncoder, TextDecoder } = require(`util`);
  12. @@ -4272,12 +4273,12 @@ class Rgba {
  13. }
  14. module.exports.Rgba = Rgba;
  15. -module.exports.__wbg_new_abda76e883ba8a5f = function() {
  16. +__wbindgen_placeholder__.__wbg_new_abda76e883ba8a5f = function() {
  17. const ret = new Error();
  18. return ret;
  19. };
  20. -module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
  21. +__wbindgen_placeholder__.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
  22. const ret = arg1.stack;
  23. const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
  24. const len1 = WASM_VECTOR_LEN;
  25. @@ -4285,7 +4286,7 @@ module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
  26. getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
  27. };
  28. -module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
  29. +__wbindgen_placeholder__.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
  30. let deferred0_0;
  31. let deferred0_1;
  32. try {
  33. @@ -4297,7 +4298,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
  34. }
  35. };
  36. -module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) {
  37. +__wbindgen_placeholder__.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) {
  38. let result;
  39. try {
  40. result = arg0 instanceof Window;
  41. @@ -4308,42 +4309,42 @@ module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) {
  42. return ret;
  43. };
  44. -module.exports.__wbg_document_e5c1786dea6542e4 = function(arg0) {
  45. +__wbindgen_placeholder__.__wbg_document_e5c1786dea6542e4 = function(arg0) {
  46. const ret = arg0.document;
  47. return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
  48. };
  49. -module.exports.__wbg_body_e70ae6abd01ae584 = function(arg0) {
  50. +__wbindgen_placeholder__.__wbg_body_e70ae6abd01ae584 = function(arg0) {
  51. const ret = arg0.body;
  52. return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
  53. };
  54. -module.exports.__wbg_createElement_5d4c76f218b78145 = function() { return handleError(function (arg0, arg1, arg2) {
  55. +__wbindgen_placeholder__.__wbg_createElement_5d4c76f218b78145 = function() { return handleError(function (arg0, arg1, arg2) {
  56. const ret = arg0.createElement(getStringFromWasm0(arg1, arg2));
  57. return ret;
  58. }, arguments) };
  59. -module.exports.__wbg_width_4c6f0048d64cf86b = function(arg0) {
  60. +__wbindgen_placeholder__.__wbg_width_4c6f0048d64cf86b = function(arg0) {
  61. const ret = arg0.width;
  62. return ret;
  63. };
  64. -module.exports.__wbg_height_21f0d3fd8f753394 = function(arg0) {
  65. +__wbindgen_placeholder__.__wbg_height_21f0d3fd8f753394 = function(arg0) {
  66. const ret = arg0.height;
  67. return ret;
  68. };
  69. -module.exports.__wbg_width_79e0847ed5883b03 = function(arg0) {
  70. +__wbindgen_placeholder__.__wbg_width_79e0847ed5883b03 = function(arg0) {
  71. const ret = arg0.width;
  72. return ret;
  73. };
  74. -module.exports.__wbg_height_e4e4e4779f8feac0 = function(arg0) {
  75. +__wbindgen_placeholder__.__wbg_height_e4e4e4779f8feac0 = function(arg0) {
  76. const ret = arg0.height;
  77. return ret;
  78. };
  79. -module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) {
  80. +__wbindgen_placeholder__.__wbg_data_fda507064d127f5b = function(arg0, arg1) {
  81. const ret = arg1.data;
  82. const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
  83. const len1 = WASM_VECTOR_LEN;
  84. @@ -4351,12 +4352,12 @@ module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) {
  85. getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
  86. };
  87. -module.exports.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  88. +__wbindgen_placeholder__.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  89. const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
  90. return ret;
  91. }, arguments) };
  92. -module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) {
  93. +__wbindgen_placeholder__.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) {
  94. let result;
  95. try {
  96. result = arg0 instanceof CanvasRenderingContext2D;
  97. @@ -4367,24 +4368,24 @@ module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = fun
  98. return ret;
  99. };
  100. -module.exports.__wbg_drawImage_fede06db74e39a60 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  101. +__wbindgen_placeholder__.__wbg_drawImage_fede06db74e39a60 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  102. arg0.drawImage(arg1, arg2, arg3);
  103. }, arguments) };
  104. -module.exports.__wbg_drawImage_f395c8e43c79a909 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
  105. +__wbindgen_placeholder__.__wbg_drawImage_f395c8e43c79a909 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
  106. arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
  107. }, arguments) };
  108. -module.exports.__wbg_getImageData_5e1c242046e6b59e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
  109. +__wbindgen_placeholder__.__wbg_getImageData_5e1c242046e6b59e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
  110. const ret = arg0.getImageData(arg1, arg2, arg3, arg4);
  111. return ret;
  112. }, arguments) };
  113. -module.exports.__wbg_putImageData_a8b3e177ee06d521 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  114. +__wbindgen_placeholder__.__wbg_putImageData_a8b3e177ee06d521 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
  115. arg0.putImageData(arg1, arg2, arg3);
  116. }, arguments) };
  117. -module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) {
  118. +__wbindgen_placeholder__.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) {
  119. let result;
  120. try {
  121. result = arg0 instanceof HTMLCanvasElement;
  122. @@ -4395,93 +4396,93 @@ module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(a
  123. return ret;
  124. };
  125. -module.exports.__wbg_width_dc225e55343b745e = function(arg0) {
  126. +__wbindgen_placeholder__.__wbg_width_dc225e55343b745e = function(arg0) {
  127. const ret = arg0.width;
  128. return ret;
  129. };
  130. -module.exports.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) {
  131. +__wbindgen_placeholder__.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) {
  132. arg0.width = arg1 >>> 0;
  133. };
  134. -module.exports.__wbg_height_3a8bec2f3fe71b26 = function(arg0) {
  135. +__wbindgen_placeholder__.__wbg_height_3a8bec2f3fe71b26 = function(arg0) {
  136. const ret = arg0.height;
  137. return ret;
  138. };
  139. -module.exports.__wbg_setheight_1761808c18403921 = function(arg0, arg1) {
  140. +__wbindgen_placeholder__.__wbg_setheight_1761808c18403921 = function(arg0, arg1) {
  141. arg0.height = arg1 >>> 0;
  142. };
  143. -module.exports.__wbg_getContext_fc99dbd3a9a7e318 = function() { return handleError(function (arg0, arg1, arg2) {
  144. +__wbindgen_placeholder__.__wbg_getContext_fc99dbd3a9a7e318 = function() { return handleError(function (arg0, arg1, arg2) {
  145. const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
  146. return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
  147. }, arguments) };
  148. -module.exports.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) {
  149. +__wbindgen_placeholder__.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) {
  150. arg0.textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
  151. };
  152. -module.exports.__wbg_appendChild_fa3b00dade9fc4cf = function() { return handleError(function (arg0, arg1) {
  153. +__wbindgen_placeholder__.__wbg_appendChild_fa3b00dade9fc4cf = function() { return handleError(function (arg0, arg1) {
  154. const ret = arg0.appendChild(arg1);
  155. return ret;
  156. }, arguments) };
  157. -module.exports.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
  158. +__wbindgen_placeholder__.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
  159. const ret = new Function(getStringFromWasm0(arg0, arg1));
  160. return ret;
  161. };
  162. -module.exports.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) {
  163. +__wbindgen_placeholder__.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) {
  164. const ret = arg0.call(arg1);
  165. return ret;
  166. }, arguments) };
  167. -module.exports.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () {
  168. +__wbindgen_placeholder__.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () {
  169. const ret = self.self;
  170. return ret;
  171. }, arguments) };
  172. -module.exports.__wbg_window_55e469842c98b086 = function() { return handleError(function () {
  173. +__wbindgen_placeholder__.__wbg_window_55e469842c98b086 = function() { return handleError(function () {
  174. const ret = window.window;
  175. return ret;
  176. }, arguments) };
  177. -module.exports.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () {
  178. +__wbindgen_placeholder__.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () {
  179. const ret = globalThis.globalThis;
  180. return ret;
  181. }, arguments) };
  182. -module.exports.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () {
  183. +__wbindgen_placeholder__.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () {
  184. const ret = global.global;
  185. return ret;
  186. }, arguments) };
  187. -module.exports.__wbindgen_is_undefined = function(arg0) {
  188. +__wbindgen_placeholder__.__wbindgen_is_undefined = function(arg0) {
  189. const ret = arg0 === undefined;
  190. return ret;
  191. };
  192. -module.exports.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
  193. +__wbindgen_placeholder__.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
  194. const ret = arg0.buffer;
  195. return ret;
  196. };
  197. -module.exports.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
  198. +__wbindgen_placeholder__.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
  199. const ret = new Uint8Array(arg0);
  200. return ret;
  201. };
  202. -module.exports.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
  203. +__wbindgen_placeholder__.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
  204. arg0.set(arg1, arg2 >>> 0);
  205. };
  206. -module.exports.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
  207. +__wbindgen_placeholder__.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
  208. const ret = arg0.length;
  209. return ret;
  210. };
  211. -module.exports.__wbindgen_debug_string = function(arg0, arg1) {
  212. +__wbindgen_placeholder__.__wbindgen_debug_string = function(arg0, arg1) {
  213. const ret = debugString(arg1);
  214. const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
  215. const len1 = WASM_VECTOR_LEN;
  216. @@ -4489,16 +4490,16 @@ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
  217. getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
  218. };
  219. -module.exports.__wbindgen_throw = function(arg0, arg1) {
  220. +__wbindgen_placeholder__.__wbindgen_throw = function(arg0, arg1) {
  221. throw new Error(getStringFromWasm0(arg0, arg1));
  222. };
  223. -module.exports.__wbindgen_memory = function() {
  224. +__wbindgen_placeholder__.__wbindgen_memory = function() {
  225. const ret = wasm.memory;
  226. return ret;
  227. };
  228. -module.exports.__wbindgen_init_externref_table = function() {
  229. +__wbindgen_placeholder__.__wbindgen_init_externref_table = function() {
  230. const table = wasm.__wbindgen_export_2;
  231. const offset = table.grow(4);
  232. table.set(0, undefined);
  233. @@ -4509,7 +4510,8 @@ module.exports.__wbindgen_init_externref_table = function() {
  234. ;
  235. };
  236. -const path = require('path').join(__dirname, 'photon_rs_bg.wasm');
  237. +// Allow opencode's Bun compiled binary to point photon-node at its embedded wasm asset.
  238. +const path = globalThis.__OPENCODE_PHOTON_WASM_PATH || require('path').join(__dirname, 'photon_rs_bg.wasm');
  239. const bytes = require('fs').readFileSync(path);
  240. const wasmModule = new WebAssembly.Module(bytes);