Why use invisible unicode character u+200d(zero-width joiner)? #1726
-
endo/packages/static-module-record/src/hidden.js Lines 1 to 2 in b288b59 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The module to program translation works only if none of the free variables of the module collide with these names that the calling convention introduces into their scope. It is our hope that no real modules are incompatible with the ses shim because they were bound to these names in global scope. JavaScript borrowed the idea of allowing generated code to include $ in compiler-generated names from Java. jQuery ensured that we would never be able to rely on the glyphs’s specialness for the intended purpose. Using an invisible code point at least minimizes the displacement of column numbers when debugging. These choices may have been extreme. |
Beta Was this translation helpful? Give feedback.
The module to program translation works only if none of the free variables of the module collide with these names that the calling convention introduces into their scope. It is our hope that no real modules are incompatible with the ses shim because they were bound to these names in global scope.
JavaScript borrowed the idea of allowing generated code to include $ in compiler-generated names from Java. jQuery ensured that we would never be able to rely on the glyphs’s specialness for the intended purpose. Using an invisible code point at least minimizes the displacement of column numbers when debugging.
These choices may have been extreme.