Bug 174935

Summary: [WTF] Introduce Private Symbols
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, buildbot, cdumez, cmarcelo, commit-queue, darin, dbates, fpizlo, ggaren, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 174971    
Attachments:
Description Flags
Patch
none
Patch none

Description Yusuke Suzuki 2017-07-28 03:07:27 PDT
Upcoming proposal of class fields[1] requires private fields.
The easiest way to implement it is adding a property with specially marked symbols.
Currently, we have private symbols, which is used for internal use cases, and managed in the hash table.
But this proposal will encourage users to create such private symbols more and more.

So, I think introducing notion of Private and Internal into WTF SymbolImpl is simpler.
We do not need to look up value from private symbol hash table no longer. SymbolImpl knows that it is a private/internal/public symbol.

[1]: https://github.com/tc39/proposal-class-fields
Comment 1 Yusuke Suzuki 2017-07-28 03:08:25 PDT
(In reply to Yusuke Suzuki from comment #0)
> Upcoming proposal of class fields[1] requires private fields.
> The easiest way to implement it is adding a property with specially marked
> symbols.
> Currently, we have private symbols, which is used for internal use cases,
> and managed in the hash table.
> But this proposal will encourage users to create such private symbols more
> and more.
> 
> So, I think introducing notion of Private and Internal into WTF SymbolImpl
> is simpler.
> We do not need to look up value from private symbol hash table no longer.
> SymbolImpl knows that it is a private/internal/public symbol.
> 
> [1]: https://github.com/tc39/proposal-class-fields

Note that class field proposal is now stage 3.
Comment 2 Yusuke Suzuki 2017-07-28 08:41:22 PDT
Created attachment 316640 [details]
Patch
Comment 3 Yusuke Suzuki 2017-07-28 09:43:29 PDT
Created attachment 316645 [details]
Patch
Comment 4 WebKit Commit Bot 2017-07-30 21:57:19 PDT
Comment on attachment 316645 [details]
Patch

Clearing flags on attachment: 316645

Committed r220053: <http://trac.webkit.org/changeset/220053>
Comment 5 WebKit Commit Bot 2017-07-30 21:57:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2017-07-30 21:58:50 PDT
<rdar://problem/33618567>
Comment 7 Yusuke Suzuki 2017-08-10 17:03:06 PDT
*** Bug 167574 has been marked as a duplicate of this bug. ***