question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SES - Function constructor this-value

See original GitHub issue

is it possible to safely preserve this strict-mode behavior in SES? its a common pre-globalThis pattern as long as the globalThis is the compartment globalThis, it seems fine 🤔

new Function('return this')() === globalThis

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kumaviscommented, Mar 16, 2021

thanks 🚀

1reaction
erightscommented, Mar 16, 2021

Yes. Caller insensitivity. Like any other function, the meaning of both Function and indirect eval are not sensitive to the strictness of their caller. That would be dynamic scoping, which is one horror that I have totally succeeded at keeping out of JS!

For both Function and indirect eval, they evaluate their code sloppy unless that code begins with a "use strict"; directive. However, SES banishes sloppy mode completely, but still with no caller sensitivity. The SES Fucntion and indirect eval evaluate their code only strict, as if always preceded by a "use strict"; directive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class: AWS.SES — AWS SDK for JavaScript
Constructs a service interface object. Each API operation is exposed as a function on service. Service Description.
Read more >
Function() constructor - JavaScript - MDN Web Docs
The Function() constructor creates a new Function object. Calling the constructor directly can create functions dynamically, ...
Read more >
SES transport - Nodemailer
SES object as the value for SES property in Nodemailer transport options. ... This value is derived from the response of SES API,...
Read more >
ses - UNPKG
The CDN for ses. ... 184, // *** Constructor Properties of the Global Object ... 4065, // TODO: since we create an anonymous...
Read more >
Constructor, operator "new" - The Modern JavaScript Tutorial
That can be done using constructor functions and the "new" operator. Constructor function. Constructor functions technically are regular ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found