01-edu / public

📚 @01-edu's Public Repository
http://public.01-edu.org/
199 stars 425 forks source link

[EXTERNAL] undefine eval() for elementary.js #2490

Open ExTBH opened 4 months ago

ExTBH commented 4 months ago

Before starting, please choose the relevant pull request Labels, Reviewers, and Assignees

DEV-#### | SUP-#### | CON-####

Why?

Clearly state the reason for this change. What problem is it solving, or what feature is it adding?

The question can be skipped using eval

function multiply(n1, n2) {
    return eval(`${n1} ${String.fromCharCode(42)} ${n2}`)
}
function divide(n1, n2) {
    return eval(`Math.trunc(${n1} ${String.fromCharCode(47)} ${n2})`)
}
function modulo(n1, n2) {
    return eval(`Math.trunc(${n1} ${String.fromCharCode(37)} ${n2})`)
}

Solution Overview

Provide an overview of the solution implemented in this pull request. This should be a high-level overview without getting into technical details. If applicable, include screenshots of UI or use GitHub-compliant mermaid graphs to represent the solution visually.

Implementation Details

Explain the details of the implementation and the reasoning behind it. What alternative approaches were considered, and why was this approach chosen?

Build Images

Please assign the label 📦 build If you want to re-build the following test images:

  • 💻 Sh
  • 🚀 JS
  • 🧩 DOM