Skip to content

Commit

Permalink
corrected prototypecompat unit tests. they enabled XPath because i ha…
Browse files Browse the repository at this point in the history
…d added document.evaluate as a stub
  • Loading branch information
thatcher committed May 21, 2009
1 parent 16506da commit ff986ea
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 922 deletions.
69 changes: 35 additions & 34 deletions dist/env.0.9.5.js
Expand Up @@ -2010,34 +2010,34 @@ __extend__(DOMElement.prototype, {
}
});

/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
$debug("Defining DocumentFragment");
/*
* DocumentFragment - DOM Level 2
Expand Down Expand Up @@ -4168,9 +4168,9 @@ __extend__(DOMDocument.prototype, {
* @seealso
* Document.evaluate
*/
evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
XPathExpression.apply(this, arguments);
},
/*evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
return new XPathExpression().evaluate();
},*/
getElementById : function(elementId) {
var retNode = null,
node;
Expand Down Expand Up @@ -7186,13 +7186,14 @@ $debug("Defining XPathExpression");
* XPathExpression
*/
$w.__defineGetter__("XPathExpression", function(){
throw new Error("Object cannot be created in this context");
return XPathExpression;
});

var XPathExpression = function() {};
__extend__(XPathExpression.prototype, {
evaluate: function(){
//TODO
//TODO for now just return an empty XPathResult
return new XPathResult();
}
});/**
* @author thatcher
Expand All @@ -7206,7 +7207,7 @@ $w.__defineGetter__("XPathResult", function(){
});

var XPathResult = function() {
this.snapshotLentgh = 0;
this.snapshotLength = 0;
this.stringValue = '';
};

Expand Down
69 changes: 35 additions & 34 deletions dist/env.js
Expand Up @@ -2010,34 +2010,34 @@ __extend__(DOMElement.prototype, {
}
});

/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
$debug("Defining DocumentFragment");
/*
* DocumentFragment - DOM Level 2
Expand Down Expand Up @@ -4168,9 +4168,9 @@ __extend__(DOMDocument.prototype, {
* @seealso
* Document.evaluate
*/
evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
XPathExpression.apply(this, arguments);
},
/*evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
return new XPathExpression().evaluate();
},*/
getElementById : function(elementId) {
var retNode = null,
node;
Expand Down Expand Up @@ -7186,13 +7186,14 @@ $debug("Defining XPathExpression");
* XPathExpression
*/
$w.__defineGetter__("XPathExpression", function(){
throw new Error("Object cannot be created in this context");
return XPathExpression;
});

var XPathExpression = function() {};
__extend__(XPathExpression.prototype, {
evaluate: function(){
//TODO
//TODO for now just return an empty XPathResult
return new XPathResult();
}
});/**
* @author thatcher
Expand All @@ -7206,7 +7207,7 @@ $w.__defineGetter__("XPathResult", function(){
});

var XPathResult = function() {
this.snapshotLentgh = 0;
this.snapshotLength = 0;
this.stringValue = '';
};

Expand Down
69 changes: 35 additions & 34 deletions dist/env.rhino.0.9.5.js
Expand Up @@ -2403,34 +2403,34 @@ __extend__(DOMElement.prototype, {
}
});

/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
/**
* @class DOMException - raised when an operation is impossible to perform
* @author Jon van Noort (jon@webarcana.com.au)
* @param code : int - the exception code (one of the DOMException constants)
*/
var DOMException = function(code) {
this.code = code;
};

// DOMException constants
// Introduced in DOM Level 1:
DOMException.INDEX_SIZE_ERR = 1;
DOMException.DOMSTRING_SIZE_ERR = 2;
DOMException.HIERARCHY_REQUEST_ERR = 3;
DOMException.WRONG_DOCUMENT_ERR = 4;
DOMException.INVALID_CHARACTER_ERR = 5;
DOMException.NO_DATA_ALLOWED_ERR = 6;
DOMException.NO_MODIFICATION_ALLOWED_ERR = 7;
DOMException.NOT_FOUND_ERR = 8;
DOMException.NOT_SUPPORTED_ERR = 9;
DOMException.INUSE_ATTRIBUTE_ERR = 10;

// Introduced in DOM Level 2:
DOMException.INVALID_STATE_ERR = 11;
DOMException.SYNTAX_ERR = 12;
DOMException.INVALID_MODIFICATION_ERR = 13;
DOMException.NAMESPACE_ERR = 14;
DOMException.INVALID_ACCESS_ERR = 15;
$debug("Defining DocumentFragment");
/*
* DocumentFragment - DOM Level 2
Expand Down Expand Up @@ -4561,9 +4561,9 @@ __extend__(DOMDocument.prototype, {
* @seealso
* Document.evaluate
*/
evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
XPathExpression.apply(this, arguments);
},
/*evaluate: function(xpathText, contextNode, nsuriMapper, resultType, result){
return new XPathExpression().evaluate();
},*/
getElementById : function(elementId) {
var retNode = null,
node;
Expand Down Expand Up @@ -7579,13 +7579,14 @@ $debug("Defining XPathExpression");
* XPathExpression
*/
$w.__defineGetter__("XPathExpression", function(){
throw new Error("Object cannot be created in this context");
return XPathExpression;
});

var XPathExpression = function() {};
__extend__(XPathExpression.prototype, {
evaluate: function(){
//TODO
//TODO for now just return an empty XPathResult
return new XPathResult();
}
});/**
* @author thatcher
Expand All @@ -7599,7 +7600,7 @@ $w.__defineGetter__("XPathResult", function(){
});

var XPathResult = function() {
this.snapshotLentgh = 0;
this.snapshotLength = 0;
this.stringValue = '';
};

Expand Down

0 comments on commit ff986ea

Please sign in to comment.