mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
10 years ago
3 changed files with 44 additions and 2 deletions
@ -0,0 +1,34 @@ |
|||
--- !ditz.rubyforge.org,2008-03-06/issue |
|||
title: lazy .prototype for objects |
|||
desc: |- |
|||
One way to deal with the annoying function prototype loop (and also to |
|||
reduce memory use) would be to implement the "prototype" property of a |
|||
function instance as an auto-spawning virtual property. |
|||
|
|||
The property would need to behave as it was present (e.g. enumerate) |
|||
but only be defined as a concrete value if actually read, written, |
|||
used in a constructor call etc. This spawning behavior doesn't have |
|||
to be exact: it can be exaggerated to spawn the property just in case |
|||
to simplify implementation. For instance, it would be OK to spawn the |
|||
property for enumeration even if the value was not ready during |
|||
enumeration. |
|||
|
|||
The lazy prototype behavior needs a flag which is cleared when the lazy |
|||
creation actually happens. This is the case because user code may |
|||
delete the prototype, and once that has been done, the prototype must not |
|||
magically spawn back. |
|||
type: :task |
|||
component: duk |
|||
release: v1.1 |
|||
reporter: Sami Vaarala <sami.vaarala@iki.fi> |
|||
status: :unstarted |
|||
disposition: |
|||
creation_time: 2014-09-26 20:46:56.145454 Z |
|||
references: [] |
|||
|
|||
id: e0372b1a5c59036f4372a1a1e919ee4a2644e7a0 |
|||
log_events: |
|||
- - 2014-09-26 20:46:56.332664 Z |
|||
- Sami Vaarala <sami.vaarala@iki.fi> |
|||
- created |
|||
- "" |
Loading…
Reference in new issue