Nick Morgan:
Now, if you do this instead:
Ctor.prototype = null;
var y = new Ctor;
y.toString;
= function ...
Here's a fiddle that illustrates the above:
http://jsfiddle.net/skilldrick/gabEN/
So, how is `toString` looked up on `y`? Is there a special case when the
2011/10/25, Arian Stolwijk ar...@aryweb.nl:
instanceof only looks at what's in the prototype chain:
http://jsfiddle.net/AZbvp/
Please post the code directly in your message next time. I don't know
how jsfiddle manages its shared codes, but if it expires it will be
lost for JSMentors archive.
Lasse Reichstein:
You can use either Object.getPrototypeOf or __proto__ (with a preference on
the other, because it's not as easily modified) to check:
prop in object !(prop in object.__proto__)
which is not same check as hasOwnProperty (if the property is both on the
object and also in
gaz Heyes gazhe...@gmail.com:
I found this which was quite surprising:
!function x(){x=123;alert(x);}()
What's the value of x without running the code?
Should be `function x(){x=123;alert(x);}`, while NFE adds in front of
the scope chain `x` which value can't be overwritten so in the body
Stoyan Stefanov:
What ES5 shims are you using that you can recommend?
As you know some of the general ES5 features cannot be implemented in
ES3 environment. Those which rely on internal properties and their
values in most cases cannot be emulated. For example `defineProperty',
Via the JSMentors mailing list you can:
Discuss ECMA-262 standard
Discuss different implementations of ECMA-262
Discuss different host environments of JavaScript
Discuss implementation of algorithms in JavaScript
Discuss your library design
Review your code
Review your book on JavaScript topic
Anton Kovalyov:
We were talking with colleagues about closures and this question came up.
When JavaScript interpreters parse a function, do they always keep its
reference to the outer scope or do they keep it _only_ when needed (i.e.
when something inside the function accesses variables from
Hi everyone.
We launched donations for JSMentors trough the PayPal:
URL: http://jsmentors.com/
The collected money will be used for the hosting, domain name,
conferences and some reconstructions of the site.
Any amount of donation is highly appreciated.
Thank you very much!
--
To view
J.R.:
Instead of:
if (window.ActiveXObject) {
We should use:
if (typeof window.ActiveXObject !== undefined) {
I would not use both approaches. I would use:
if (typeof ActiveXObject != 'undefined') {
//...
}
Or as Diego proposed:
if ('ActiveXObject' in this) {
//...
}
When this
jemptymethod :
I inherited some code that essentially does this:
You should consider how these changes will affect on existing code in
your application. In order to prevent incompatibilities with existing
code, you should decide the best approach for you.
user = deserializeUser(params); //var
Sam Merrell:
What are the groups thoughts on safely accessing a nested objects
value that may be undefined?
Firstly you should answer on the question, are you going to create
objects which properties value may be undefined?
I recently came across a blog post [1]
from Oliver Steele where he
Scott Sauyet:
Not at all. Have you done any performance tests?
I haven't yet. I am planning to test against built-in JSON.parse and
various Crockford's implementation.
I have made front-end for this code:
URL:http://asenbozhilov.com/json.html
You can use it as a validator of your JSON
Diego Perini:
I have one question, without having gone through reading the specs.
Would it be useful, and still spec compliant, to detect an Invalid
leading comma too as an error instead of a Invalid property name ?
You already detect the Invalid trailing comma and the passed objects
could
Scott Sauyet:
I look forward to seeing it. Nice job so far!
I implemented abstract `walk` operation and therefore I added an
optional argument `reviver'. Both are according ECMA-262-5.
You can see the changes:
URL: https://github.com/abozhilov/json/blob/master/src/json.js
Also I changed the
Scott Sauyet :
Have you considered allowing a reviver function? Perhaps it's not
important to your testing and debugging purposes, but it might be an
interesting extension...
The main goal was to create proper parser, but I like the idea for
reviewer function and I'll add it.
I made some
Dmitry A. Soshnikov :
http://dmitrysoshnikov.com/notes/note-4-two-words-about-hoisting/
Excellent article.
The most interesting example for me was:
// a.js
function foo() {
alert(1);
}
foo(); // 2 ?
// b.js
function foo() {
alert(2);
}
Which demonstrates how Function Declarations are
JSMentors is looking for logo designer who is able to create the logo
of JSMentors.
While we are not commercial organization, we are not able to pay for
this. We are only able to add the name of the creator at the main site
of JSMentors:
URL: http://jsmentors.com
If someone is interested please
Miller Medeiros:
why not create some sort of contest?
I and Rey thought about it. The our idea was to create competition and
giving the vote to members of JSMentors.
We are able to create a page with proposed logos, their authors and
ideas behind the design.
The problem is that, while we are
When we launched the JSMentors the our goal was to provide place where
we can share the our opinion and knowledge in Javascript and browser
scripting. Here are welcome any level developers.
We achieved these goals and the moment JSMentors has over 1200 members
who are different level developers.
Juriy Zaytsev :
But is it a bug really? As far as I know, web storage spec (
http://dev.w3.org/html5/webstorage/) makes no clarification on whether
interface members are writable; or enumerable/configurable for that matter.
WebIDL spec, however, does mention something about interface members
The last week I explored some things about `localStorage'. The most
interesting and meanwhile confusing things are described in two
articles about `localStorage':
URL:
http://www.bennadel.com/blog/2105-Exploring-HTML5-s-localStorage-Persistent-Client-Side-Key-Value-Pairs.htm
URL:
אריה גלזר arieh.gla...@gmail.com:
BTW - if any of you find other tools more comfortable - like jsbin - that's
fine too, my point is t separate code from message
I am not sure how this is helpful. With Rey we are working on posting
guidelines and of course there will be point about code
Garrett Smith wrote:
On 12/18/10, Marc Harter wav...@gmail.com wrote:
My name is Marc Harter (@wavded). I'm stationed in Eau Claire, WI and work
with JavaScript daily. Very glad this list is here, was turned off by
c.l.js spam and trolling
Can't remember seeing any posts from you
Juriy Zaytsev wrote:
Is Brendan on this list?
Unfortunately he is not at the list. I've sent invitation to him, be he
hasn't replied yet. I hope he would join at the list. Also Douglas
Crockford would accept and his invitation.
--
To view archived discussions from the original JSMentors
qwertypants:
I'm a bit new to Object Inheritance in JavaScript and I'd like to find
the best way to do so. I have seen a few techniques from Resig to
Crockford, but I'd like to know the simplest and most effective way to
create object from existing ones. Is there any native way that this
can
Garrett Smith wrote:
Juriy Zaytsev wrote:
var beget = (function() {
function F(){ };
All good except for the extra empty statement there. AYK, semicolon is
not needed after the FD.
I guess this is typo according knowledge of Juriy. Anyway, more
important is discussion about
JSDude wrote:
this.eval — as I understand right is Reference, where
ReferenceName is eval. I'm always think that this is global eval
because it's evaling in context window.
The simple answer on your question is:
eval('...');
The evaluation of MemberExpression return Reference which in
27 matches
Mail list logo