ejs icon indicating copy to clipboard operation
ejs copied to clipboard

feat: use globalThis shim

Open kumavis opened this issue 1 year ago • 2 comments

This supports environments like https://hardenedjs.org/ that support globalThis but do not support getting the global object via the Function constructor.

kumavis avatar Mar 05 '25 21:03 kumavis

Seems like it could be a minor security concern, that people could simply declare their own globalThis variable outside the EJS context. Might it not make more sense to inline the (relatively small) code for this polyfill directly into EJS?

mde avatar Mar 07 '25 17:03 mde

This is the code: https://github.com/ungap/global-this/blob/master/esm/index.js

mde avatar Mar 07 '25 17:03 mde