Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/mjs/startup/hasown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {MathJax} from '#js/components/global.js';

if (!Object.hasOwn && MathJax.config.startup.polyfillHasOwn) {
Object.hasOwn = function (el, prop) {
if (typeof el === 'undefined' || el === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
return Object.prototype.hasOwnProperty.call(Object(el), prop);
}
}
1 change: 1 addition & 0 deletions components/mjs/startup/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './hasown.js';
import './lib/startup.js';

import {combineDefaults} from '#js/components/global.js';
Expand Down
1 change: 1 addition & 0 deletions ts/components/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ if (typeof MathJax._.startup === 'undefined') {
typeset: true,
ready: Startup.defaultReady.bind(Startup),
pageReady: Startup.defaultPageReady.bind(Startup),
polyfillHasOwn: true,
});
combineWithMathJax({
startup: Startup,
Expand Down