Skip to content

Commit

Permalink
cleaning house in lighthouse for 1.0.0 tag
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcher committed Sep 10, 2009
1 parent e7d73b0 commit 58a5df4
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 11 deletions.
1 change: 1 addition & 0 deletions bin/jquery-1.3.2-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load("build/runtest/env.js");

$env("test/index.html", {
//let it load the script from the html
logLevel: $env.INFO,
scriptTypes: {
"text/javascript" :true
},
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PROJECT: env-js
BUILD_MAJOR: 1
BUILD_MINOR: 0
BUILD_ID: rc6
BUILD_ID: rc7
BUILD: ${PROJECT}.${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
VERSION: ${BUILD} ${DSTAMP}

Expand Down
Binary file modified dist/env-js.jar
Binary file not shown.
11 changes: 8 additions & 3 deletions dist/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Envjs env-js.1.0.rc6
* Envjs env-js.1.0.rc7
* Pure JavaScript Browser Environment
* By John Resig <http://ejohn.org/>
* Copyright 2008-2009 John Resig, under the MIT License
Expand Down Expand Up @@ -4295,6 +4295,11 @@ __extend__(DOMDocument.prototype, {
event = document.createEvent();
event.initEvent("load");
$w.dispatchEvent( event, false );

//also use DOMContentLoaded event
var domContentLoaded = document.createEvent();
domContentLoaded.initEvent("DOMContentLoaded");
$w.dispatchEvent( domContentLoaded, false );
};
xhr.send();
},
Expand Down Expand Up @@ -7714,7 +7719,7 @@ var Event = function(options){
$cancelable = options.cancelable?options.cancelable:true,
$currentTarget = options.currentTarget?options.currentTarget:null,
$eventPhase = options.eventPhase?options.eventPhase:Event.CAPTURING_PHASE,
$target = options.eventPhase?options.eventPhase:document,
$target = options.target?options.target:document,
$timestamp = options.timestamp?options.timestamp:new Date().getTime().toString(),
$type = options.type?options.type:"";
return __extend__(this,{
Expand Down Expand Up @@ -8366,7 +8371,7 @@ window.clearInterval = window.clearTimeout = function(num){
*/
// Window Events
$debug("Initializing Window Event.");
var $events = [],
var $events = [{}],
$onerror,
$onload,
$onunload;
Expand Down
13 changes: 9 additions & 4 deletions dist/env.rhino.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Envjs env-js.1.0.rc6
* Envjs env-js.1.0.rc7
* Pure JavaScript Browser Environment
* By John Resig <http://ejohn.org/>
* Copyright 2008-2009 John Resig, under the MIT License
Expand Down Expand Up @@ -637,7 +637,7 @@ var Envjs = function(){
$env.restoreScope = restoreScope;

})(Envjs);/*
* Envjs env-js.1.0.rc6
* Envjs env-js.1.0.rc7
* Pure JavaScript Browser Environment
* By John Resig <http://ejohn.org/>
* Copyright 2008-2009 John Resig, under the MIT License
Expand Down Expand Up @@ -4933,6 +4933,11 @@ __extend__(DOMDocument.prototype, {
event = document.createEvent();
event.initEvent("load");
$w.dispatchEvent( event, false );

//also use DOMContentLoaded event
var domContentLoaded = document.createEvent();
domContentLoaded.initEvent("DOMContentLoaded");
$w.dispatchEvent( domContentLoaded, false );
};
xhr.send();
},
Expand Down Expand Up @@ -8352,7 +8357,7 @@ var Event = function(options){
$cancelable = options.cancelable?options.cancelable:true,
$currentTarget = options.currentTarget?options.currentTarget:null,
$eventPhase = options.eventPhase?options.eventPhase:Event.CAPTURING_PHASE,
$target = options.eventPhase?options.eventPhase:document,
$target = options.target?options.target:document,
$timestamp = options.timestamp?options.timestamp:new Date().getTime().toString(),
$type = options.type?options.type:"";
return __extend__(this,{
Expand Down Expand Up @@ -9004,7 +9009,7 @@ window.clearInterval = window.clearTimeout = function(num){
*/
// Window Events
$debug("Initializing Window Event.");
var $events = [],
var $events = [{}],
$onerror,
$onload,
$onunload;
Expand Down
4 changes: 4 additions & 0 deletions rhino/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<property name="RHINO_JAR"
location="js.jar"
description="Rhino JS Engine"/>
<property name="JLINE_JAR"
location="jline-0.9.94.jar"
description="jLine Command Line"/>
<property name='JAVA_DEBUG'
value='on'/>
<property name='JAVA_TARGET'
Expand Down Expand Up @@ -91,6 +94,7 @@
manifest="${SRC_DIR}/META-INF/MANIFEST.MF"
compress="${JAR_COMPRESSION}">
<fileset dir="${CLASS_DIR}" includes="**/*.class"/>
<zipfileset src="${JLINE_JAR}" includes="**/*"/>
</jar>
<copy file="${ENV_JAR_DIST}" tofile="${ENV_JAR_LATEST}"/>
</target>
Expand Down
6 changes: 3 additions & 3 deletions src/dom/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ __extend__(DOMDocument.prototype, {
$w.dispatchEvent( event, false );

//also use DOMContentLoaded event
event = document.createEvent();
event.initEvent("DOMContentLoaded");
$w.dispatchEvent( event, false );
var domContentLoaded = document.createEvent();
domContentLoaded.initEvent("DOMContentLoaded");
$w.dispatchEvent( domContentLoaded, false );
};
xhr.send();
},
Expand Down
40 changes: 40 additions & 0 deletions test/unit/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,43 @@ test("Bubbling event ONLY bubbles 'up'", function() {

clickChecks("Click td", 2, 1);
});

/*
* Re ticket #68
* http://envjs.lighthouseapp.com/projects/21590/tickets/68-wrong-this-in-wdispatchevent-for-on-callbacks
* will close once we verify this test is correct and it passes
test("Check that 'this' in event handlers refers to the object receiving the event", function() {
expect(4);
// get a few objects the event will bubble up to
var img = document.getElementById('eventsFrame')
.contentDocument.getElementById('theIMG');
var a = document.getElementById('eventsFrame')
.contentDocument.getElementById('theA');
var p = document.getElementById('eventsFrame')
.contentDocument.getElementById('theP');
var li = document.getElementById('eventsFrame')
.contentDocument.getElementById('theLI');
// add handlers
addHdlr = function(elem, id) {
elem.addEventListener('click', function(event){
try{
Envjs.log(event.target+'='+img);
Envjs.log(this+'='+elem);
ok( event.target === img && this === elem,
"Scope: 'this' refers to element '" + id + "'");
}catch(e){print(e);}
});
}
addHdlr(img, "theIMG");
addHdlr(a, "theA");
addHdlr(p, "theP");
addHdlr(li, "theLI");
// create and dispatch event
__click__(img);
});*/


0 comments on commit 58a5df4

Please sign in to comment.