mathjs/test/node-tests/pollutedObjectPrototype.js
2024-05-22 08:46:14 +02:00

12 lines
321 B
JavaScript

// let's pollute the Object prototype...
/* eslint no-extend-native: ["error", { "exceptions": ["Object"] }] */
// loading mathjs should not crash
import { create, all } from '../../lib/esm/entry/mainAny'
Object.prototype.foo = () => {}
const math = create(all)
// outputs '2i'
console.log(math.format(math.sqrt(-4)))