Closed GoogleCodeExporter closed 9 years ago
I'm inclined to introduce a new pre-defined object, "global" (or GD) to save
the shared data. My idea is not to let normal functions modify it, but only
the start-up process Andrew is thinking of can modify it and after that it's
read-only.
Maybe my Separate Context approach was wrong; Still, we have function-local
"this" object.
Original comment by umi.tan...@gmail.com
on 17 Apr 2012 at 9:43
Something not modifiable won't meet the case. It's intended as a
between-invocation stash.
Original comment by AMDuns...@gmail.com
on 19 Apr 2012 at 12:29
But the behavior is unpredictable as the invocation order may be changed during
planning. What's the real world use case?
Original comment by umi.tan...@gmail.com
on 19 Apr 2012 at 12:52
Invocation order is only unpredictable when a statement calls more than one
function. The real world use case is as a stash for data between statements.
That's how it's used in PLPerl and PLPython.
Original comment by AMDuns...@gmail.com
on 26 Apr 2012 at 2:41
My concern is JavaScript is fragile language. A lot of premature developers
break the runtime environment by modifying the global variable and builtin
objects. That is, if that is the case, today you can assign any properties to
the plv8 object which is visible from everyone.
Original comment by umi.tan...@gmail.com
on 27 Apr 2012 at 12:56
And there has been a lot of effort to guard this nature from the language
specification like Object.freeze(), Object.seal(), plus from the framework like
commonJS where each module can play only in the separated namespace.
Original comment by umi.tan...@gmail.com
on 27 Apr 2012 at 12:59
I think it's enough to just have plv8 as it stands today, isn't it? The object
can have any property except for pre-defined functions. If there's no
objection, I'm closing this.
Original comment by umi.tan...@gmail.com
on 2 May 2012 at 7:21
Closing, given my comment above.
Original comment by umi.tan...@gmail.com
on 30 May 2012 at 5:53
Original issue reported on code.google.com by
umi.tan...@gmail.com
on 3 Feb 2012 at 10:29