|
Provide private symbols through internal APIs
Adds a notion of private symbols, mainly intended for internal use, especially, self-hosting of built-in types that would otherwise require new C++ classes.
On the JS side (i.e., in built-ins), private properties can be created and accessed through a set of macros:
NEW_PRIVATE(print_name)
HAS_PRIVATE(obj, sym)
GET_PRIVATE(obj, sym)
SET_PRIVATE(obj, sym, val)
DELETE_PRIVATE(obj, sym)
In the V8 API, they are accessible via a new class Private, and respective HasPrivate/Get/Private/SetPrivate/DeletePrivate methods on calss Object.
These APIs are designed and restricted such that their implementation can later be replaced by whatever ES7+ will officially provide.
R=yangguo@chromium.org
BUG=
Committed: http://code.google.com/p/v8/source/detail?r=17683
Total comments: 6
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+286 lines, -118 lines) |
Patch |
|
M |
include/v8.h
|
View
|
1
2
3
|
4 chunks |
+34 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/api.cc
|
View
|
1
2
3
|
6 chunks |
+45 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/array-iterator.js
|
View
|
1
2
|
3 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/factory.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/factory.cc
|
View
|
1
2
3
|
1 chunk |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/heap.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/heap.cc
|
View
|
1
2
3
|
3 chunks |
+14 lines, -1 line |
0 comments
|
Download
|
|
M |
src/macros.py
|
View
|
1
2
3
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/messages.js
|
View
|
|
4 chunks |
+38 lines, -33 lines |
0 comments
|
Download
|
|
M |
src/objects.h
|
View
|
1
2
3
|
4 chunks |
+12 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/objects-debug.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/objects-inl.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/objects-printer.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/parser.cc
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
src/runtime.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime.cc
|
View
|
1
2
3
4
|
5 chunks |
+38 lines, -20 lines |
0 comments
|
Download
|
|
M |
test/cctest/test-api.cc
|
View
|
1
2
|
1 chunk |
+64 lines, -0 lines |
0 comments
|
Download
|
|
A + |
test/mjsunit/harmony/private.js
|
View
|
1
2
3
|
5 chunks |
+5 lines, -32 lines |
0 comments
|
Download
|
|
M |
test/mjsunit/harmony/symbols.js
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 13 (0 generated)
|