forked from svaarala/duktape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathissue-7b588526e608305af04054ed760a13a5c137c4e5.yaml
46 lines (39 loc) · 1.58 KB
/
issue-7b588526e608305af04054ed760a13a5c137c4e5.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- !ditz.rubyforge.org,2008-03-06/issue
title: add a non-standard getter/setter 'key' argument
desc: |-
Standard getter gets the original object in the 'this' binding and no
arguments. Standard setter gets the original object in the 'this' binding
and no other arguments. Because the key is not given, user code must
create multiple accessor function objects (or use the Proxy object).
Extend both getter and setter argument list with the key argument. This
will probably break very little code and is easy to achieve when a setter
or getter is triggered by a property access:
print(foo.bar); // getter
foo.bar = 'quux'; // setter
However, setter/getter can also be invoked "out of context":
var desc = Object.getOwnPropertyDescriptor(foo, 'bar');
var getter = desc.get;
print(getter());
Above, the getter is invoked with the expectation that it will return the
same value as when evaluating "foo.bar". However, Duktape won't know the
property name from context of the call.
Even with this limitation, it might be worthwhile to extend the accessor
behavior, which will still be useful for most code.
type: :task
component: duk
release: v0.11
reporter: Sami Vaarala <[email protected]>
status: :closed
disposition: :fixed
creation_time: 2014-06-12 22:59:13.174464 Z
references: []
id: 7b588526e608305af04054ed760a13a5c137c4e5
log_events:
- - 2014-06-12 22:59:13.265944 Z
- Sami Vaarala <[email protected]>
- created
- ""
- - 2014-06-13 21:52:06.384447 Z
- Sami Vaarala <[email protected]>
- closed with disposition fixed
- ""