Production issue with JS target

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Production issue with JS target

sledorze
Hello,
I'm currently deploying an application within a website which has already a lot of JS script.

When I integrate my haxe geenrated code; it makes the other scripts crash because the js.Boot._init_ method has added some prototype function to the Array object and the JS code in the page iterates over arrays values using keys like this:

for (i in _obj) {
    _obj[i].coords = getElementPosition(_obj[i].liElement);
  }

so; this means that 'i' has the 'copy', 'insert', 'remove' and 'iterator' entries..
It's really annoying considering that the legacy Scripts are not changeable under 3 months.. (don't ask me why.. we're in an oldy fashionned big corp)

I plan to do a big hack and put some hack into the _init_ generated function in order to silently bypass the errors..

Any *better* Idea?
At least; food for though!

Stephane
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

sledorze
It is worst than expected as some other logic rely on comparing key between two arrays and decide some logic around that..
so, no work around found yet..

Stephane

P.S.: Another reason to prefer unintrusive abstraction (extension / type classes)
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

sledorze
Tried to patch the Array extern and introduce some extensions methods but it made the typer fail..

File "typer.ml", line 2560, characters 8-14: Assertion failed
Build halted with errors (haxe.exe).

start to think I'm going into serious issues..


On Wed, Nov 16, 2011 at 3:40 PM, sledorze [via Haxe] <[hidden email]> wrote:
It is worst than expected as some other logic rely on comparing key between two arrays and decide some logic around that..
so, no work around found yet..

Stephane

P.S.: Another reason to prefer unintrusive abstraction (extension / type classes)



If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000579.html
To unsubscribe from Production issue with JS target, click here.
NAML



--
Stéphane Le Dorze


Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

Cauê W.
In reply to this post by sledorze
Maybe https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty this could work?

2011/11/16 sledorze <[hidden email]>
It is worst than expected as some other logic rely on comparing key between
two arrays and decide some logic around that..
so, no work around found yet..

Stephane

P.S.: Another reason to prefer unintrusive abstraction (extension / type
classes)


--
View this message in context: http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000579.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

sledorze
Oh... 
You saved my live for a couple of minutes..
..they also test against..

 IE6 :'(


2011/11/16 Cauê W. [via Haxe] <[hidden email]>
Maybe https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty this could work?

2011/11/16 sledorze <[hidden email]>
It is worst than expected as some other logic rely on comparing key between
two arrays and decide some logic around that..
so, no work around found yet..

Stephane

P.S.: Another reason to prefer unintrusive abstraction (extension / type
classes)


--
View this message in context: http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000579.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000663.html
To unsubscribe from Production issue with JS target, click here.
NAML



--
Stéphane Le Dorze


Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

Cauê W.
ouch!

this one is compatible, I think
http://msdn.microsoft.com/en-us/library/adebfyya(v=vs.94).aspx

2011/11/16 sledorze <[hidden email]>
Oh... 
You saved my live for a couple of minutes..
..they also test against..

 IE6 :'(


2011/11/16 Cauê W. [via Haxe] <[hidden email]>
2011/11/16 sledorze <[hidden email]>

It is worst than expected as some other logic rely on comparing key between
two arrays and decide some logic around that..
so, no work around found yet..

Stephane

P.S.: Another reason to prefer unintrusive abstraction (extension / type
classes)


--
View this message in context: http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000579.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7000663.html
To unsubscribe from Production issue with JS target, click here.
NAML



--
Stéphane Le Dorze


Tel: <a href="tel:%2B33%20%280%29%206%2008%20%C2%A076%2070%2015" value="+33608767015" target="_blank">+33 (0) 6 08  76 70 15




View this message in context: Re: Production issue with JS target
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

MarcWeber
In reply to this post by sledorze
> so; this means that 'i' has the 'copy', 'insert', 'remove' and 'iterator'
> entries..
> It's really annoying considering that the legacy Scripts are not changeable
> under 3 months.. (don't ask me why.. we're in an oldy fashionned big corp)
THere are some hacks allowing you to load code in a different namespace
(iframe or such - there are multiple ways) - not sure whether theiy work
in all browsers.
 
> I plan to do a big hack and put some hack into the _init_ generated function
> in order to silently bypass the errors..
If it can be fixed that easily I'd just do it ..

jquery has its own namespace you can hide:

jquery($){
}();

or such. does probably not work with prototyping stuff though.

That's all I know
Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

sledorze
They don't allow iframe neither.. (I dunno if it would have worked but I think that sharing prototype then would be a major security issue)..
They'll fix their stuff in the next months.. I'll try to make it work patching prototypes.. (oh.. joy..)

On Wed, Nov 16, 2011 at 6:11 PM, MarcWeber [via Haxe] <[hidden email]> wrote:
> so; this means that 'i' has the 'copy', 'insert', 'remove' and 'iterator'
> entries..
> It's really annoying considering that the legacy Scripts are not changeable
> under 3 months.. (don't ask me why.. we're in an oldy fashionned big corp)
THere are some hacks allowing you to load code in a different namespace
(iframe or such - there are multiple ways) - not sure whether theiy work
in all browsers.
 
> I plan to do a big hack and put some hack into the _init_ generated function
> in order to silently bypass the errors..
If it can be fixed that easily I'd just do it ..

jquery has its own namespace you can hide:

jquery($){
}();

or such. does probably not work with prototyping stuff though.

That's all I know
Marc Weber

--
haXe - an open source web programming language
http://haxe.org



If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7001105.html
To unsubscribe from Production issue with JS target, click here.
NAML



--
Stéphane Le Dorze


Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

MarcWeber
Excerpts from sledorze's message of Wed Nov 16 18:27:28 +0100 2011:
> They don't allow iframe neither.. (I dunno if it would have worked but I
http://msdn.microsoft.com/en-us/scriptjunkie/gg278167
That was the article I recalled.
Looks like they are using the keyword 'sandboxing javascript'

Marc Weber

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Production issue with JS target

sledorze
Oh!
That looks very interesting indeed! 
Thanks a lot!

On Wed, Nov 16, 2011 at 6:42 PM, MarcWeber [via Haxe] <[hidden email]> wrote:
Excerpts from sledorze's message of Wed Nov 16 18:27:28 +0100 2011:
> They don't allow iframe neither.. (I dunno if it would have worked but I
http://msdn.microsoft.com/en-us/scriptjunkie/gg278167
That was the article I recalled.
Looks like they are using the keyword 'sandboxing javascript'

Marc Weber

--
haXe - an open source web programming language
http://haxe.org



If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/Production-issue-with-JS-target-tp7000487p7001248.html
To unsubscribe from Production issue with JS target, click here.
NAML



--
Stéphane Le Dorze