From 596c9a1d16786f3833754703bfda23d2a487cf29 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 3 Mar 2025 00:33:57 +0000 Subject: [PATCH] Transform error messages --- lib/polyfill.js | 5 +++-- package.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/polyfill.js b/lib/polyfill.js index 0fb9518..e86b7dd 100644 --- a/lib/polyfill.js +++ b/lib/polyfill.js @@ -18,6 +18,8 @@ 'use strict'; +var format = require('@stdlib/error-tools-fmtprodmsg'); + // MAIN // /** @@ -27,10 +29,9 @@ * @throws {Error} not implemented */ function polyfill( size ) { // eslint-disable-line no-unused-vars - throw new Error( 'not supported. The current environment does not support SharedArrayBuffers, and, unfortunately, SharedArrayBuffers cannot be polyfilled. For shared memory applications, upgrade your runtime environment to one which supports SharedArrayBuffers.' ); + throw new Error( format('01T09') ); } - // EXPORTS // module.exports = polyfill; diff --git a/package.json b/package.json index 4f03b37..6801ef8 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-has-sharedarraybuffer-support": "^0.2.2" + "@stdlib/assert-has-sharedarraybuffer-support": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/array-float64": "^0.2.2", @@ -96,4 +97,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file