denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.5k stars 5.18k forks source link

Bug: wrong `this` binding in `buble` #24413

Open marvinhagemeister opened 2 weeks ago

marvinhagemeister commented 2 weeks ago

Error doesn't happen in Node.

[!] (buble plugin) TypeError: this.body.initialise is not a function
build/es5.js (undefined:undefined)
TypeError: this.body.initialise is not a function
    at new Program (file:///Users/marvinh/dev/oss/json5/node_modules/buble/src/program/Program.js:31:12)
    at Object.transform (file:///Users/marvinh/dev/oss/json5/node_modules/buble/src/index.js:90:9)
    at Object.transform (file:///Users/marvinh/dev/oss/json5/node_modules/rollup-plugin-buble/dist/rollup-plugin-buble.cjs.js:20:18)
    at file:///Users/marvinh/dev/oss/json5/node_modules/rollup/dist/rollup.js:20780:41

Steps to reproduce

  1. Clone https://github.com/json5/json5
  2. Run npm i
  3. Run DENO_FUTURE=1 deno task build

Version: Deno 1.44.4

marvinhagemeister commented 2 weeks ago

Looked a bit into it and they do some __proto__ shenanigans.