Related relevant proposal/strawman/whatever:
- https://github.com/isiahmeadows/private-data-proposal
- https://github.com/tc39/proposal-class-fields/issues/94
- https://github.com/zenparsing/js-classes-1.1/issues/44
And in particular in the first linked issue, I did propose an `export
{ ... } to
I think it'd be nice if there was something also easier, based only on file
names or directory structure.
```js
// log-foo.js
import Foo from './Foo'
console.log(Foo)
```
```js
// Foo.js
class Foo {}
export Foo for './log-foo'
// or with expressions, all files in this folder
export Foo for './*'
Ah, interesting! That would be useful!
*/#!/*JoePea
On Sun, Apr 15, 2018 at 11:58 AM, Mike Samuel wrote:
> The box function defined in github.com/mikesamuel/tc39-module-keys
> enables things like this.
>
>
> On Sun, Apr 23, 2017 at 4:42 PM, /#!/JoePea wrote:
>
>> Is there a way to share some s
The box function defined in github.com/mikesamuel/tc39-module-keys enables
things like this.
On Sun, Apr 23, 2017 at 4:42 PM, /#!/JoePea wrote:
> Is there a way to share some secret value across a few modules, and
> prevent other modules? f.e. prevent modules of an app dev who is importing
> mo
> GATEWAY
That's an interesting idea, Bradley, thanks! I originally wanted this for
implementing "protected" class members (i.e. sharing a WeakMap across
subclasses in different files), but I've since done this another way that
is even better: https://github.com/trusktr/lowclass.
With lowclass we
my English
is not accurate)
From: Jordan Harband [mailto:ljh...@gmail.com]
Sent: Sunday, April 23, 2017 7:03 PM
To: /#!/JoePea
Cc: es-discuss
Subject: Re: Share a secret across ES6 specific modules, so that other modules
cannot access the secret?
Nope. This is exactly why it seems that
Ah yes, my bad. `var`!
On Mon, Apr 24, 2017 at 3:43 PM, Allen Wirfs-Brock
wrote:
>
> On Apr 24, 2017, at 12:34 PM, Bradley Meck wrote:
>
> To an extent, yes. You can use hoisting of function declarations and
> circular dependencies to create a "gateway". During circular dependencies,
> you have
> On Apr 24, 2017, at 12:34 PM, Bradley Meck wrote:
>
> To an extent, yes. You can use hoisting of function declarations and circular
> dependencies to create a "gateway". During circular dependencies, you have a
> time where function declarations are available but evaluation has not
> occure
To an extent, yes. You can use hoisting of function declarations and
circular dependencies to create a "gateway". During circular dependencies,
you have a time where function declarations are available but evaluation
has not occured. During that time you can setup your private state. Then,
immediat
Nope. This is exactly why it seems that "protected" couldn't have any way
to work that has "hard" enforcement.
The only true privacy in JS is via closure (including WeakMaps), or via the
upcoming "private fields" proposal, assuming it stays as "hard private".
Anything shared is publicly accessible
10 matches
Mail list logo