HaxeFoundation / HaxeFoundation/haxe

[js] shallow-expose writes to global

Open
#7,366 3 comments 0 reactions 0 assignees View on GitHub
platform-javascript
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

According to the doc, `-D shallow-expose` should not write to the global window / export.

https://haxe.org/manual/target-javascript-expose.html#shallow-expose

3.2.1 generates the same code as that in the example.

But since 3.3.0 it writes to global, with `$hx_exports` declared as:

```js
var $hx_exports = typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.