stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.94k stars 174 forks source link

`this` in exported function should be `undefined` #1532

Open sapphi-red opened 1 month ago

sapphi-red commented 1 month ago

Describe the bug

this in exported function should be undefined.

export function foo() {
  return this // this is undefined
}

Link to the blitz that caused the error

https://stackblitz.com/edit/node-7bhlmx?file=index.js

Steps to reproduce

  1. Open https://stackblitz.com/edit/node-7bhlmx?file=index.js
  2. Run node index.js
  3. Assertion failed: result should be undefined message is output

Expected behavior

No message is output

Parity with Local

Screenshots

No response

Platform

Browser name  = Chrome
Full version  = 129.0.0.0
Major version = 129
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 88197450,
  "usedJSHeapSize": 84717194,
  "jsHeapSizeLimit": 4294705152
}
Hash = 134daa3c

Additional context

No response