stevesouders / controljs

Automatically exported from code.google.com/p/controljs
Apache License 2.0
26 stars 9 forks source link

script is not executed if there is eval inside it used. No errors shown in FireBug console #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a script with eval
var Foo = {
    init: function() {
        eval("alert('test')");
    }
};

2. Try to load it with control.js

What is the expected output? What do you see instead?
Expected to see Foo in DOM tree. When you try to call Foo.init(), it appears 
undefined.

What version of the product are you using? On what operating system?
MacOS, FireFox 3.6

Original issue reported on code.google.com by michael.bevz on 16 Dec 2010 at 2:48

GoogleCodeExporter commented 9 years ago
I am unable to reproduce this issue.  The Foo.init() function can be called 
when the code is added inline via this script tag:  

<script type=text/cjs>
var Foo = {
    init: function() {
            eval("alert('test')");
    }
};
</script>

Original comment by serverhe...@gmail.com on 16 Dec 2010 at 8:02

GoogleCodeExporter commented 9 years ago
May be it makes difference to load it as an external script?

Original comment by michael.bevz on 16 Dec 2010 at 8:14

GoogleCodeExporter commented 9 years ago
Can you paste your HTML and JavaScript?  I cannot see why, if it's an external 
file, this would be a problem. 

Original comment by serverhe...@gmail.com on 16 Dec 2010 at 9:15