Skip to content

Commit

Permalink
fix: #3114 build warnings related to a number of wrong `/* #__PURE__ …
Browse files Browse the repository at this point in the history
…*/` annotations
  • Loading branch information
josdejong committed Jan 17, 2024
1 parent a37e8c3 commit 3f6cf76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
`IndexNode`, `OperatorNode`, and `RelationalNode` (#3123). Thanks @sylee957.
- Added a fully featured code editor example with CodeMirror and Katex (#3027).
Thanks @dvd101x.
- Fix: #3114 build warnings related to a number of wrong `/* #__PURE__ */`
annotations.


# 2024-01-12, 12.3.0
Expand Down
2 changes: 1 addition & 1 deletion src/entry/configReadonly.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DEFAULT_CONFIG } from '../core/config.js'
import { MATRIX_OPTIONS, NUMBER_OPTIONS } from '../core/function/config.js'

// create a read-only version of config
export const config = /* #__PURE__ */ function (options) {
export const config = function (options) {
if (options) {
throw new Error('The global config is readonly. \n' +
'Please create a mathjs instance if you want to change the default configuration. \n' +
Expand Down
2 changes: 1 addition & 1 deletion src/type/unit/physicalConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const createAvogadro = /* #__PURE__ */ unitFactory('avogadro', '6.0221407
export const createBoltzmann = /* #__PURE__ */ unitFactory('boltzmann', '1.380649e-23', 'J K^-1')
export const createFaraday = /* #__PURE__ */ unitFactory('faraday', '96485.33212331001', 'C mol^-1')
export const createFirstRadiation = /* #__PURE__ */ unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2')
// export const createSpectralRadiance = /* #__PURE__ */ unitFactory('spectralRadiance', '1.1910429723971881e-16', 'W m^2 sr^-1') // TODO spectralRadiance
// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1
export const createLoschmidt = /* #__PURE__ */ unitFactory('loschmidt', '2.686780111798444e25', 'm^-3')
export const createGasConstant = /* #__PURE__ */ unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1')
export const createMolarPlanckConstant = /* #__PURE__ */ unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1')
Expand Down
12 changes: 6 additions & 6 deletions src/utils/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function isInteger (value) {
* @param {number} x
* @returns {number}
*/
export const sign = /* #__PURE__ */ Math.sign || function (x) {
export const sign = Math.sign || function (x) {
if (x > 0) {
return 1
} else if (x < 0) {
Expand All @@ -39,7 +39,7 @@ export const sign = /* #__PURE__ */ Math.sign || function (x) {
* @param {number} x
* @returns {number}
*/
export const log2 = /* #__PURE__ */ Math.log2 || function log2 (x) {
export const log2 = Math.log2 || function log2 (x) {
return Math.log(x) / Math.LN2
}

Expand All @@ -48,7 +48,7 @@ export const log2 = /* #__PURE__ */ Math.log2 || function log2 (x) {
* @param {number} x
* @returns {number}
*/
export const log10 = /* #__PURE__ */ Math.log10 || function log10 (x) {
export const log10 = Math.log10 || function log10 (x) {
return Math.log(x) / Math.LN10
}

Expand All @@ -57,7 +57,7 @@ export const log10 = /* #__PURE__ */ Math.log10 || function log10 (x) {
* @param {number} x
* @returns {number}
*/
export const log1p = /* #__PURE__ */ Math.log1p || function (x) {
export const log1p = Math.log1p || function (x) {
return Math.log(x + 1)
}

Expand All @@ -70,7 +70,7 @@ export const log1p = /* #__PURE__ */ Math.log1p || function (x) {
* @param {number} x
* @returns {number} Returns the cubic root of x
*/
export const cbrt = /* #__PURE__ */ Math.cbrt || function cbrt (x) {
export const cbrt = Math.cbrt || function cbrt (x) {
if (x === 0) {
return x
}
Expand All @@ -97,7 +97,7 @@ export const cbrt = /* #__PURE__ */ Math.cbrt || function cbrt (x) {
* @param {number} x
* @return {number} res
*/
export const expm1 = /* #__PURE__ */ Math.expm1 || function expm1 (x) {
export const expm1 = Math.expm1 || function expm1 (x) {
return (x >= 2e-4 || x <= -2e-4)
? Math.exp(x) - 1
: x + x * x / 2 + x * x * x / 6
Expand Down

0 comments on commit 3f6cf76

Please sign in to comment.