Skip to content

this in exported function should be undefined #1532

@sapphi-red

Description

@sapphi-red

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions