@sirdarckcat @kangax
Thanks again!
Quote
([1,2]) ==> ([globals.gp(Number(1),Number(2))])
Fixed. This is a protection mechanism to stop assignments to __parent__ or something evil. I fixed the Array detection
Quote
({ '': 1 })['']; // undefined
0x50; // SyntaxError
switch('x'){case'x':1}; // SyntaxError (note lack of space after case)
All fixed! Nice ones! I completely forgot about hex for numbers, I've added a new regexp to detect those.
Quote
(function(){ return arguments; })(); // undefined
1..toString()
These are unsupported at the moment. I plan to create the arguments object and allow it once I've locked it down. toString will be callable in future but not settable as a function. At least that's what I think at the moment.
Quote
var Number=function(){}
Number.prototype=window.Number;
There is logic to my madness :) Number(1) produces a typeof == number. Using a prototype does not. So this would break typeof for numbers :( unless you know of a better way of course.
Here is a interesting bug in JSReg which is also related to the prototypes. If you do [1] it creates a blank array without a number. This is because it thinks it is defining the length. But I'd have thought that calling the constructor without the new prefix would result in the same behaviour as []. Anyone any ideas on this?
Quote
asdf:for(;;){for(;;)break asdf;}alert(1);
Good catch! I didn't have time to fix this and I'm off to bed now so maybe tomorrow night
@sirdarckcat
I've added a new feature to JSReg which will allow you to change the value of this and therefore support javascript events easier. The eval method has another argument which specifies the object for this. Here is a code sample of how it works:-
var obj = {};
parser.eval('this.x=123', obj);
alert(obj.x);//123 :)
------------------------------------------------------------------------------------------------------------
"People who say it cannot be done should not interrupt those who are doing it.";
labs : [
www.businessinfo.co.uk]
blog : [
www.thespanner.co.uk]
Hackvertor : [
hackvertor.co.uk]
Edited 1 time(s). Last edit at 07/22/2009 05:24PM by Gareth Heyes.