Code Monkey home page Code Monkey logo

env-js's People

Contributors

client9 avatar gleneivey avatar jeresig avatar jganetsk avatar smparkes avatar thatcher avatar youngnh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

env-js's Issues

compareDocumentPosition Error

I am getting the following error when using/loading the jQuery colorbox plugin.

https://github.com/jackmoore/colorbox/blob/master/jquery.colorbox.js

comparing document position cboxLoadingGraphic cboxLoadingOverlay
!!!!!!!!!!! ERROR !!!!!!!!!!!

-message = Cannot read property "childNodes" from null
-fileName = steal/rhino/env.js
-lineNumber = 3480
-name = TypeError

I have identified the line in the plugin to the following line:

https://github.com/jackmoore/colorbox/blob/master/jquery.colorbox.js#L409

Everything works fine in jQuery1.8.3, but breaks when I move to 1.9.1

I noticed that the add function in jQuery has changed in 1.9.1

If I change the following line in env.js in compareDocumentPosition:

if(a.parentNode === b.parentNode){

to

if(a.parentNode && a.parentNode === b.parentNode) {

then things work.

Thoughts?

Problem building on Windows (1.2.13)

The unit tests fail on windows with, e.g.:

file://c/:/Src/thatcher-env-js-cb738b9/specs/frame/proxy.html JavaException: java.net.UnknownHostException: c

This seems to be a problem with the urlparse methods, most likely urlparse.urlspllit(), since that is the only one that references ':', essentially it is producing an invalid windows file URL.

No env-js.jar

I can't find a way to get env-js.jar at present.

The zip file from http://www.envjs.com/release/undefined doesn't include it. The basic ant build from the zip download doesn't create it. I can't find it in github. Nevertheless, everything all over envjs.com recommends its use for emulating the browser most effectively, for example this page...
http://www.envjs.com/doc/guide-1.0.x

In my envjs directory, expanded and after calling ant and make ...
envjs$ find . -name '*.jar'
./rhino/jline.jar
./rhino/js.jar

It's also missing from the website - links promising env-js.jar go to a dead end.
http://www.envjs.com/release/1.0.x

What did I miss?

Created script node is evaluated immediately

We have in our script something like:

var e = document.createElement("script");
e.text ="X";

After running this code via Env-js Rhino complains that X is not defined, it means that this created Script node is evaluated immediately even if it is not attached to document. That is wrong.

Rhino XHR 404 Response Error

In Rhino/Java, a 404 status received from a resource generates and FileNotFound exception. Depending on the server action and content type, an error stream may or may not be available. This patch checks to ensure the stream is defined before attempting to read from it.

--- /env-js/envjs/platform/rhino.js 2011-04-07 21:37:32.000000000 -0600
+++ envjs/platform/rhino.js 2011-04-11 12:22:42.000000000 -0600
@@ -385,12 +385,14 @@
             instream = connection.getErrorStream();
         }

-        while ((length = instream.read(buffer, 0, 1024)) != -1) {
-            outstream.write(buffer, 0, length);
+        if (instream) {
+            while ((length = instream.read(buffer, 0, 1024)) != -1) {
+                outstream.write(buffer, 0, length);
+            }
+            instream.close();
         }

         outstream.close();
-        instream.close();

         if(binary){
             xhr.responseText = new java.lang.String(outstream.toByteArray(), 'UTF-8')+'';

Issue with addEvent in dojo/_firebug/firebug.js

After loading envjs and start loading dojo and hit this.
load (dojo_root_path + 'dojo.js');
require( ["dojo/io/script"] ); //Hitting issue at this line.

js: "C:/workspace//client/scripts/dojo-sdk/1.7.1/dojo//_firebug/firebug.js", line 879: uncaught JavaScript runtime exception: TypeError: Cannot find function attachEvent in object [object HTMLDocument].
at C:/workspace/client/scripts/dojo-sdk/1.7.1/dojo//_firebug/firebug.js:879 (addEvent)
at C:/workspace/client/scripts/dojo-sdk/1.7.1/dojo//_firebug/firebug.js:1168
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:997
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:1123
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:1111
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:1146
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:721
at C:\workspace\client\scripts\dojo-sdk\1.7.1\dojo\dojo.js:124
at C:\workspace\client\scripts\example\dojo-simple.js:30

1.3pre1: parser.js missing primitive byte types

parser.js is attempting to use undefined primitive var '_3_3B_classLit' and undefined function toByteArray when parsing a string with an escaped HTML entity.

For example:
"test &" in a fixture will die within function $clinit_131 with this error:
Envjs Caught exception: com.google.gwt.core.client.JavaScriptException: (ReferenceError): _3_3B_classLit is not defined stack: ReferenceError: _3_3B_classLit is not defined at $clinit_131

I did some searching and found these types and the toByteArray function defined in /src/parser/refactor/nu.validator.htmlparser/stacknode.js and ported them into parser.js, however, I am still receiving errors.

I'll continue to investigate this, but any information on this refactor would be appreciated. Thanks!

minor improvement to __trim__

i've benchmarked a bunch of trim methods on Rhino by pointing Env.JS at http://stevenlevithan.com/demo/trim.cfm

C:\Documents and Settings\user\My Documents\Downloads\rhino1_7R2>java -jar js.jar -opt -1
Rhino 1.7 release 2 2009 03 22
js> load('env.rhino.1.2.js')
[  Envjs/1.6 (Rhino; U; Windows XP x86 5.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
js> Envjs.scriptTypes['text/javascript'] = true;
true
js> window.location='http://stevenlevithan.com/demo/trim.cfm'
http://stevenlevithan.com/demo/trim.cfm
js> $('times').value = 200
200
js> benchmark();
js> $('log').innerHTML
Original length: 27663
trim1: 422ms (length: 27656)
trim2: 797ms (length: 27656)
trim3: 828ms (length: 27656)
trim4: 1156ms (length: 27656)
trim5: 1469ms (length: 27656)
trim6: 3922ms (length: 27656)
trim7: 3656ms (length: 27656)
trim8: 2079ms (length: 27656)
trim9: 5969ms (length: 27656)
trim10: 0ms (length: 27656)
trim11: 32ms (length: 27656)
trim12: 32ms (length: 27656)

but for smaller strings i get

Original length: 55
trim1: 16ms (length: 49)
trim2: 15ms (length: 49)
trim3: 31ms (length: 49)
trim4: 31ms (length: 49)
trim5: 31ms (length: 49)
trim6: 78ms (length: 49)
trim7: 78ms (length: 49)
trim8: 47ms (length: 49)
trim9: 172ms (length: 49)
trim10: 62ms (length: 49)
trim11: 31ms (length: 49)
trim12: 15ms (length: 49)

trim1 seems to take half the time of the current trim method (trim4), might be an idea to switch to this one.

Clicking submit input in form does not cause form submission

Below is an example Rhino session showing the problem. Notice that the "submit" function call causes a print statement and the input click does not.

Example HTML file (form.html):
----------------------------------------------------------------------
<html>
<body>
<form>
<input type="submit" />
</form>
</body>
</html>

Rhino Session:
----------------------------------------------------------------------
js> load('lib/env.rhino.js')
js> load('lib/jquery-1.3.2.js')
js> window.location = 'form.html'
form.html
js> $('body').size();
1
js> $('form').submit(function() { print('submitted!'); });
[object Object]
js> $('form').submit();
submitted!
[object Object]
js> $('input').click();
[object Object]
js>

Opening local page fails

Hi there,

I've noticed that loading a local page would fail.

Example:
window.location = "app_host.html";

The error message is:
failed to open file file://E/:/David/Dev/www/fix_acdsee_db/app_host.html JavaException: java.net.UnknownHostException: E

This is because the URL of the file is wrong. It should be file:/// instead of file:// (notice the additional '/').

Here's a quick fix in xhr.js:
// if base is still empty, then we are in QA mode loading local
// files. Get current working directory
if (!base) {
base = 'file:///' + Envjs.getcwd() + '/';
}

I hope this helps.

Kayhadrin

xhr and css test fail

xhr-spec:
[java] FAIL{xhr|Location} Died on test #6: "expected_path" is not defined.
[java] timer error
[java] function () {
[java] if (config.timeout) {
[java] clearTimeout(config.timeout);
[java] }
[java] config.blocking = false;
[java] process();
[java] }
[java] TypeError: Cannot set property "disabled" of null to "null"

css-spec:
[java] FAIL{css|document.styleSheets} document.styleSheets exists
[java] FAIL{css|document.styleSheets} Died on test #2: Cannot call method "toString" of undefined
[java]
[java] RESULTS: ( of 41 total tests )
[java] PASSED: 39
[java] FAILED: 2

Any ideas?

cookie problems in version 1.2

I don't know whether this has been solved in 1.3 or not. but the problem is that when there are multi same headers such as "Set-Cookie", only the last one will be filled in xhr.headers.
The cause root is in rhino.js, when iterating the headers from raw urlconnection, only simply "headers[name]=value" , so previous headers with same name will be overwriten.

Frame proxy test fails

 [java] [FAIL](182){window|frame proxy} .contentDocument.title, expected: Envjs Proxy Spec result: Untitled Document

Probably related to this exception:
[java] failed to open file file://C/:/env-js/specs/frame/proxy.html Java Exception: java.net.UnknownHostException: C

On this line, I assume:
frame.src = '../frame/proxy.html';

Disable logging

When running envjs with Rhino I always see this message:

[ Envjs/1.6 (Rhino; U; Windows 7 amd64 6.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ]

Can this logging be disabled?

Ant build failure

Hi,

I'm trying to build env.js and I'm getting this error:

html-spec:
[echo]
[echo] Executing HTML Spec
[java] js: Couldn't read source file "dist/parser.js: dist/parser.js (No such file or directory)".
[java] js: Couldn't read source file "dist/xhr.js: dist/xhr.js (No such file or directory)".
[java] js: Couldn't read source file "dist/window.js: dist/window.js (No such file or directory)".
[java] js: Couldn't read source file "local_settings.js: local_settings.js (No such file or directory)".

I can confirm that the files aren't in the directories that Ant it looking for.

Cheers

Robbie

jquery live event with default action

Suppose I have a document like this one:

  <html>
    <head>
      <title></title>
      <script src="/javascripts/jquery-1.4.2.js" type="text/javascript"></script>
      <script>
        $(document).ready(function() {
          $('a.clickable').live('click', function(event) {
            document.title = 'live click event triggered';
            return false;
          });
        });
      </script>
    </head>
    <body>
      <a href='/foo' class='clickable'>link</a>
    </body>
  </html>

Then the event handler should be called (i.e. document.title set to 'live click event triggered') and the default action of the link (i.e. the request to /foo) should not happen.

What actually happens is: the request to /foo happens first and the event handler is called afterwards.

Jquery registers a live event handler to the topmost dom node, so the handler will be called after the event has bubbled up the entire tree. In envjs 0.3.4 event bubbling seems to happen at the very end of the __dispatchEvent__ method after default actions have been evaluated.

events: differences between "interface" names and "feature" names

I believe all event interfaces does not end with the letter "s", seems to me those are features names. It is "MouseEvent" and not "MouseEvents", "Event" and not "Events". Though some browser accepts both syntaxes for some of them, but only the first is the correct one as for specifications.

document.createEvent("Event");
document.implementation.hasFeature("Events", "");

document.createEvent("MouseEvent");
document.implementation.hasFeature("MouseEvents", "");

Thank you for the great work and the details you have put in it.

cookie management

Hi,

Not sure if this is the right place, but I can't seem to subscribe to Google Groups at the moment, so here I am.

I've got some code that I've run in a browser that captures a cookie and sends that as a header on subsequent requests, but it doesn't seem to be getting set when using envjs and Rhino. To be honest, I'm not sure if this is something from envjs or rhino which isn't working as I'd expect.

I managed to get the cookie set using this, but it'd be nice if the container handled that. Any ideas?

Thanks

Robbie

jQuery.ajaxSetup({
'beforeSend': function(xhr) {
xhr.setRequestHeader("Cookie", sessionToken);
}
});

IPv6 Support

XMLHttpRequest fails for IPv6 URIs with a MalformedURLException.

Content-Length needs to be specdified for spydermonkey port

The default implementation doesn't work appropriately for POST/PUT requests. The server receives an empty message body. There needs to be added 'Content-Length' parameter to the header of the request. I changed the code in envjs/platform/spydermonkey.js as follows:

if(data && (xhr.method == "PUT" || xhr.method == "POST" )) {
    if(data instanceof Document){
        data = (new XMLSerializer()).serializeToString(data);
    } else {
        data = data + ''
    }
    if(data.length&&data.length>0){
        connection.putheader('Content-Length', data.length);
        connection.endheaders(data);
    }else{
        connection.endheaders();
    }
}else{
    connection.endheaders();
}

Tag 1.3.pre1 Ant Build Failure on rhino-env target

I checked out the master branch and ran the build. Then I tried the tag and ran the build for some reason they are both failing. I know the reason but fixing that leads to more failures: (See In Attachment: Ant Build Log # Run 1)

env-js/specs/platform/rhino.js has invalid path to dependencies
#5 load('dist/platform/core.js');
#6 load('dist/platform/rhino.js');
#7 load('dist/console.js');

/dist should actually point to envjs folder. I fixed it here but that lead to more problems. (See In Attachment: Ant Build Log # Run 2)

I don't have the time or expertise to fix the problem at the moment, would appreciate if someone could point me to the fix.

Thanks,
Rishik

Ant Build Log # Run 1

Buildfile: C:\Users\rdhar\env-js\build.xml
[echo] {
[echo] 'BUILD_PROPERTIES': {
[echo] 'PROJECT': 'env-js',
[echo] 'BUILD_MAJOR': '1',
[echo] 'BUILD_MINOR': '3',
[echo] 'BUILD_ID': 'pre01',
[echo] 'BUILD_VERSION': '1.3.pre01',
[echo] 'BUILD': 'env-js.1.3.pre01',
[echo] 'VERSION': 'env-js.1.3.pre01 20110429'
[echo] },
[echo] 'ENVIRONMENT':{
[echo] 'BASEDIR': 'C:\Users\rdhar\env-js',
[echo] 'SRC_DIR': 'C:\Users\rdhar\env-js\src',
[echo] 'TOOLS_DIR': 'C:\Users\rdhar\env-js\tools',
[echo] 'RHINO_JAR': 'C:\Users\rdhar\env-js\rhino\js.jar',
[echo] 'PREFIX': 'C:\Users\rdhar\env-js\envjs',
[echo] 'DOCS_DIR': 'C:\Users\rdhar\env-js\envjs\docs',
[echo] 'TEST_DIR': 'C:\Users\rdhar\env-js\specs',
[echo] 'DIST_DIR': 'C:\Users\rdhar\env-js\envjs',
[echo] 'HAS_LOCAL': '${HAS_LOCAL}'
[echo] },
[echo] 'DISTRIBUTABLES': {
[echo] 'CORE_DIST': 'C:\Users\rdhar\env-js\envjs\platform\core.js',
[echo] 'RHINO_DIST': 'C:\Users\rdhar\env-js\envjs\platform\rhino.js',
[echo] 'NODE_DIST': 'C:\Users\rdhar\env-js\envjs\platform\node.js',
[echo] 'CONSOLE_DIST': 'C:\Users\rdhar\env-js\envjs\console.js',
[echo] 'DOM_DIST': 'C:\Users\rdhar\env-js\envjs\dom.js',
[echo] 'EVENT_DIST': 'C:\Users\rdhar\env-js\envjs\event.js',
[echo] 'TIMER_DIST': 'C:\Users\rdhar\env-js\envjs\timer.js',
[echo] 'HTML_DIST': 'C:\Users\rdhar\env-js\envjs\html.js',
[echo] 'PARSER_DIST': 'C:\Users\rdhar\env-js\envjs\parser.js',
[echo] 'XHR_DIST': 'C:\Users\rdhar\env-js\envjs\xhr.js',
[echo] 'CSS_DIST': 'C:\Users\rdhar\env-js\envjs\css.js',
[echo] 'WINDOW_DIST': 'C:\Users\rdhar\env-js\envjs\window.js',
[echo] 'ENV_DIST': 'C:\Users\rdhar\env-js\envjs\env.js',
[echo] 'ENV_RHINO': 'C:\Users\rdhar\env-js\envjs\env.rhino.js',
[echo] 'ENV_NODE': 'C:\Users\rdhar\env-js\envjs\env.node.js',
[echo] 'ENV_SPYDERMONKEY':'C:\Users\rdhar\env-js\envjs\env.spydermonkey.js',
[echo] 'ENV_RUBYRACER':'C:\Users\rdhar\env-js\envjs\env.rubyracer.js'
[echo] }
[echo] }
core-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\core.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\core.js
rhino-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\rhino.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\rhino.js
node-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\node.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\node.js
spydermonkey-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\spydermonkey.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\spydermonkey.js
rubyracer-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\rubyracer.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\rubyracer.js
johnson-env:
[echo] Building C:\Users\rdhar\env-js\envjs\platform\johnson.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\johnson.js
console:
[echo] Building C:\Users\rdhar\env-js\envjs\console.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\console.js
dom:
[echo] Building C:\Users\rdhar\env-js\envjs\dom.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\dom.js
event:
[echo] Building C:\Users\rdhar\env-js\envjs\event.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\event.js
timer:
[echo] Building C:\Users\rdhar\env-js\envjs\timer.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\timer.js
html:
[echo] Building C:\Users\rdhar\env-js\envjs\html.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\html.js
parser:
[echo] Building C:\Users\rdhar\env-js\envjs\parser.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\parser.js
xhr:
[echo] Building C:\Users\rdhar\env-js\envjs\xhr.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\xhr.js
css:
[echo] Building C:\Users\rdhar\env-js\envjs\css.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\css.js
window:
[echo] Building C:\Users\rdhar\env-js\envjs\window.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\window.js
zip:
rhino-env-spec:
[echo] Executing Rhino Env Spec
[java] js: Couldn't read source file "dist/platform/core.js: dist\platform\core.js (The system cannot find the path specified)".
[java] js: Couldn't read source file "dist/platform/rhino.js: dist\platform\rhino.js (The system cannot find the path specified)".
[java] js: Couldn't read source file "dist/console.js: dist\console.js (The system cannot find the path specified)".
[java] js: uncaught JavaScript runtime exception: ReferenceError: "Envjs" is not defined.

BUILD FAILED
C:\Users\rdhar\env-js\build.xml:212: Java returned: 3

Ant Build Log # Run 2

Buildfile: build.xml
[echo] {
[echo] 'BUILD_PROPERTIES': {
[echo] 'PROJECT': 'env-js',
[echo] 'BUILD_MAJOR': '1',
[echo] 'BUILD_MINOR': '3',
[echo] 'BUILD_ID': 'pre01',
[echo] 'BUILD_VERSION': '1.3.pre01',
[echo] 'BUILD': 'env-js.1.3.pre01',
[echo] 'VERSION': 'env-js.1.3.pre01 20110429'
[echo] },
[echo] 'ENVIRONMENT':{
[echo] 'BASEDIR': 'C:\Users\rdhar\env-js',
[echo] 'SRC_DIR': 'C:\Users\rdhar\env-js\src',
[echo] 'TOOLS_DIR': 'C:\Users\rdhar\env-js\tools',
[echo] 'RHINO_JAR': 'C:\Users\rdhar\env-js\rhino\js.jar',
[echo] 'PREFIX': 'C:\Users\rdhar\env-js\envjs',
[echo] 'DOCS_DIR': 'C:\Users\rdhar\env-js\envjs\docs',
[echo] 'TEST_DIR': 'C:\Users\rdhar\env-js\specs',
[echo] 'DIST_DIR': 'C:\Users\rdhar\env-js\envjs',
[echo] 'HAS_LOCAL': '${HAS_LOCAL}'
[echo] },
[echo] 'DISTRIBUTABLES': {
[echo] 'CORE_DIST': 'C:\Users\rdhar\env-js\envjs\platform\core.js',
[echo] 'RHINO_DIST': 'C:\Users\rdhar\env-js\envjs\platform\rhino.js',
[echo] 'NODE_DIST': 'C:\Users\rdhar\env-js\envjs\platform\node.js',
[echo] 'CONSOLE_DIST': 'C:\Users\rdhar\env-js\envjs\console.js',
[echo] 'DOM_DIST': 'C:\Users\rdhar\env-js\envjs\dom.js',
[echo] 'EVENT_DIST': 'C:\Users\rdhar\env-js\envjs\event.js',
[echo] 'TIMER_DIST': 'C:\Users\rdhar\env-js\envjs\timer.js',
[echo] 'HTML_DIST': 'C:\Users\rdhar\env-js\envjs\html.js',
[echo] 'PARSER_DIST': 'C:\Users\rdhar\env-js\envjs\parser.js',
[echo] 'XHR_DIST': 'C:\Users\rdhar\env-js\envjs\xhr.js',
[echo] 'CSS_DIST': 'C:\Users\rdhar\env-js\envjs\css.js',
[echo] 'WINDOW_DIST': 'C:\Users\rdhar\env-js\envjs\window.js',
[echo] 'ENV_DIST': 'C:\Users\rdhar\env-js\envjs\env.js',
[echo] 'ENV_RHINO': 'C:\Users\rdhar\env-js\envjs\env.rhino.js',
[echo] 'ENV_NODE': 'C:\Users\rdhar\env-js\envjs\env.node.js',
[echo] 'ENV_SPYDERMONKEY':'C:\Users\rdhar\env-js\envjs\env.spydermonkey.js',
[echo] 'ENV_RUBYRACER':'C:\Users\rdhar\env-js\envjs\env.rubyracer.js'
[echo] }
[echo] }

core-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\core.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\core.js
[echo]

rhino-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\rhino.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\rhino.js
[echo]

node-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\node.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\node.js
[echo]

spydermonkey-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\spydermonkey.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\spydermonkey.js
[echo]

rubyracer-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\rubyracer.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\rubyracer.js
[echo]

johnson-env:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\platform\johnson.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\platform\johnson.js
[echo]

console:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\console.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\console.js
[echo]

dom:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\dom.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\dom.js
[echo]

event:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\event.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\event.js
[echo]

timer:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\timer.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\timer.js
[echo]

html:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\html.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\html.js
[echo]

parser:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\parser.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\parser.js
[echo]

xhr:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\xhr.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\xhr.js
[echo]

css:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\css.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\css.js
[echo]

window:
[echo]
[echo] Building C:\Users\rdhar\env-js\envjs\window.js
[echo] Finished Building C:\Users\rdhar\env-js\envjs\window.js
[echo]

zip:

rhino-env-spec:
[echo]
[echo] Executing Rhino Env Spec
[java] js: uncaught JavaScript runtime exception: ReferenceError: "exports" is not defined.
[java]
[java] js: uncaught JavaScript runtime exception: ReferenceError: "require" is not defined.
[java]
[java] js: uncaught JavaScript runtime exception: ReferenceError: "require" is not defined.
[java]
[java] js: uncaught JavaScript runtime exception: TypeError: Cannot call method "onExit" of undefined
[java]

BUILD FAILED
C:\Users\rdhar\env-js\build.xml:212: Java returned: 3

Total time: 1 second

Env.js Website Down?

Is Env.js being discontinued? Please update the README.md page with project status.

Does it works with Ruby 1.9 and V8 on Linux box ?

Hello,

I try to write a little script with Ruby on a Linux Fedora 64 bits box.
I am using the gem 'therubyracer-heroku-0.8.1' for the V8 machine because the gem 'therubyracer' fails to compile on 64 bits with gcc RedHat 4.5.1.

So, in my script, i load the 'envjs/rubyracer.rb' and it success with Ruby 1.8.7 but fails with Ruby 1.9.2 for two reasons :

-1) 'configure_context' method fails for compatibility reason on 'eval'. Just add to_s method to the parameter of 'eval'.
-2) Exception raised with that stack :

๐Ÿ‘Ž Uncaught TypeError: Cannot convert object to primitive value

ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:118:in block in v8': undefined methodSetHiddenValue' for # (NoMethodError)
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:117:in tap'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:117:inv8'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:111:in block (2 levels) in v8'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:110:ineach'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:110:in block in v8'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:109:intap'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:109:in v8'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:19:inblock (2 levels) in []='
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:75:in block in open'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/context.rb:79:inenter'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/portal.rb:74:in open'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:18:inblock in []='
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:17:in tap'
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/object.rb:17:in[]='
ruby-192p136/lib/ruby/gems/1.9.1/gems/therubyracer-heroku-0.8.1.pre3/lib/v8/context.rb:58:in []='
envjs/rubyracer.rb:47:inconfigure_context'
from ./go.sh:7:in load'
from ./go.sh:7:in'

Any idea ?

Regards.

Bug with Envjs.WriteToFile in envjs/platform/rubyracer.js on Linux

Hi,

if you run './bin/envjs rubyracer ./examples/pictures/boot.js'
you receive an exception because Envjs.WriteToFile fails to open the file to write.
Just add in the source of WriteToFile this test :
if(/^file:///.test(url))
url = url.substring(7,url.length);

Regards.

Settings problem with Ruby 1.9 and TheRubyRacer V8.

Hello,

With this little script :

puts " ARGV_0 <#{ARGV.join(", ")}> (#{ARGV.class})"
["foo",2,3,4].each{|p| ARGV.push p}
puts " ARGV_1 <#{ARGV.join(", ")}> (#{ARGV.class})"
begin
puts " $FILENAME <#{$FILENAME}> (#{$FILENAME.class})"
rescue => ex
puts " *** EXCEPTION <#{ex.message}>\n STACK=<#{ex.backtrace.join("\n")}>"
end
puts " ARGV_2 <#{ARGV.join(", ")}> (#{ARGV.class})"

If you start it with Ruby 1.8 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
$FILENAME <-> (String)
ARGV_2 <foo, 2, 3, 4> (Array)
which is right and works with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

but if you try it with Ruby 1.9 you will have :
ARGV_0 <> (Array)
ARGV_1 <foo, 2, 3, 4> (Array)
*** EXCEPTION <No such file or directory - foo>
STACK=<./this_script.rb:XX:in `

'>
ARGV_2 <2, 3, 4> (Array)
which does not work with 'bin/envjs rubyracer foo.js' as written in the last line of 'envjs/rubyracer.rb'.

I suggest to ignore the global variable '$FILENAME'
Probably you have that problem with all JavaScript engines and Ruby.

Regards.

Getting an error using this with Capybara 1.0.0

It sates that the Node cannot inherit from a module, if you patch that up by changing the node class to

class Node < Capybara::Driver::Node

Then you get a driver not found error, which can be fixed by adding

Capybara.register_driver :envjs do |app|
  Capybara::Driver::Envjs.new(app)
end

But then i got stuck with another claiming that it Capybara::Driver::Envjs::Node didn't have a node method.

Is anyone else able to get this running with capybara 1.0.0 (i'm also using spec) ??

Is "}, get xml() {" found in dom.js really correct JavaScript syntax?

Is "}, get xml() {" found in dom.js really correct JavaScript syntax?

       return __removeChild__(this, itemIndex);             // return removed node
    },
    get xml() {
          var ret = "";

          // create string containing concatenation of all (but last) Attribute string values (separated by spaces)
          for (var i=0; i < this.length -1; i++) {
            ret += this[i].xml +" ";
          }

          // add last Attribute to string (without trailing space)
          if (this.length > 0) {
            ret += this[this.length -1].xml;
          }

          return ret;
    },
    toString : function(){

Ant build failure (OS X 10.6.4)

Hello,

I am trying to build env-js and I am getting the following errors:

[java] failed to load content JavaException: java.net.ConnectException: Connection refused
[java] FAIL{window|Default Browser Events - Serialized Submit Button} new page loaded
[java] FAIL{window|Default Browser Events - Serialized Submit Button} correct submit button value serialized

....

[java] RESULTS: ( of 214 total tests )
[java] PASSED: 212
[java] FAILED: 2

BUILD FAILED
/Users/cjoudrey/env-js/build.xml:646: Java returned: 42

Any ideas?

1.3pre1: jQuery 1.4.4 elements inaccessible with document.getElementById

Setup: Create an element with an ID attribute from a string in jQuery 1.4.2 or 1.4.4 and append it to the DOM.
$('< p id="test" />').appendTo(document.body);
$('#test').length; // 0
$('p').length; // 1 (still accessible by tagName)

Result: env-js' document.getElementById('test') returns null, as the element is not found in document.indexes['#test']

Creating a "single-tag" element using the string syntax in jQuery triggers createElement directly, and bypasses this issue if the attribute is added after the element is in the DOM:

var paragraph = $('< p />').appendTo(document.body);
paragraph.attr('id', 'test');
$('#test').length; // 1

The only difference between these flows is that a documentFragment is constructed for the string that specifies attributes. I'm still in the process of debugging and will update this issue with any progress.

window.location = '#something'

in browsers, setting window.location to '#something' does not cause a page reload. It does in env-js though. i would like to use env.js with a single page web app and this behaviour is preventing the app from working properly when clicking links like .

i would like to write a patch that allows clicking of links to hashes. would you be interested in accepting such a change? From what I understand so far, it means changes to a.js to include the hash in the href getter, and changes to location.assign to identify when the change is a hash change only. i will include tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.