Skip to content

Commit

Permalink
Export DOMException; remove custom assertions; etc. (#174)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher J. Brody <chris.brody+brodybits@gmail.com>
  • Loading branch information
karfau and brodybits committed Jan 17, 2021
1 parent 8698e6b commit dbd2171
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 536 deletions.
15 changes: 7 additions & 8 deletions lib/dom.js
@@ -1,10 +1,3 @@
/*
* DOM Level 2
* Object DOMException
* @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
* @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
*/

function copy(src,dest){
for(var p in src){
dest[p] = src[p];
Expand Down Expand Up @@ -66,7 +59,12 @@ var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((Exce
var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);


/**
* DOM Level 2
* Object DOMException
* @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
* @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
*/
function DOMException(code, message) {
if(message instanceof Error){
var error = message;
Expand Down Expand Up @@ -1251,6 +1249,7 @@ try{

//if(typeof require == 'function'){
exports.Node = Node;
exports.DOMException = DOMException;
exports.DOMImplementation = DOMImplementation;
exports.XMLSerializer = XMLSerializer;
//}
27 changes: 26 additions & 1 deletion readme.md
Expand Up @@ -98,6 +98,30 @@ DOM level2 method and attribute:
normalize()
isSupported(feature, version)
hasAttributes()
* [DOMException](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html)
The DOMException class has the following constants (and `value` of type `Number`):

1. `DOMException.INDEX_SIZE_ERR` (`1`)
1. `DOMException.DOMSTRING_SIZE_ERR` (`2`)
1. `DOMException.HIERARCHY_REQUEST_ERR` (`3`)
1. `DOMException.WRONG_DOCUMENT_ERR` (`4`)
1. `DOMException.INVALID_CHARACTER_ERR` (`5`)
1. `DOMException.NO_DATA_ALLOWED_ERR` (`6`)
1. `DOMException.NO_MODIFICATION_ALLOWED_ERR` (`7`)
1. `DOMException.NOT_FOUND_ERR` (`8`)
1. `DOMException.NOT_SUPPORTED_ERR` (`9`)
1. `DOMException.INUSE_ATTRIBUTE_ERR` (`10`)
1. `DOMException.INVALID_STATE_ERR` (`11`)
1. `DOMException.SYNTAX_ERR` (`12`)
1. `DOMException.INVALID_MODIFICATION_ERR` (`13`)
1. `DOMException.NAMESPACE_ERR` (`14`)
1. `DOMException.INVALID_ACCESS_ERR` (`15`)

The DOMException object has the following properties:
code
This property is of type Number.

* extends the Error type thrown as part of DOM API:

* [DOMImplementation](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-102161490)

Expand Down Expand Up @@ -228,7 +252,8 @@ DOM level 3 support:

DOM extension by xmldom
---
* [Node] Source position extension;

* [Node] Source position extension;

attribute:
//Numbered starting from '1'
Expand Down
130 changes: 0 additions & 130 deletions test/assert.js

This file was deleted.

0 comments on commit dbd2171

Please sign in to comment.