Skip to content

Commit 4e31406

Browse files
Conform to JS Standard and throw new Errors closes SolidOS#3
1 parent 6144cc2 commit 4e31406

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/ns.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ var $rdf = require('rdflib')
1111
// This used to be a faw function (no ".expand" but that caused the module exports all to be dropped)
1212
thisModule.expand = function (prefixed) {
1313
var pair = prefixed.split(':')
14-
if (pair.length === 0) throw 'Prefixed name has no colon: ' + prefixed
15-
if (!(pair[0] in thisModule)) throw 'Unregistered namespace prefix in: ' + prefixed
14+
if (pair.length === 0) throw new Error('Prefixed name has no colon: ' + prefixed)
15+
if (!(pair[0] in thisModule)) throw new Error('Unregistered namespace prefix in: ' + prefixed)
1616
return thisModule[pair[0]](pair[1])
1717
}
1818

19-
thisModule.auth = $rdf.Namespace('http://www.w3.org/ns/auth/acl#'); // @@ obsolete - use acl:
19+
thisModule.auth = $rdf.Namespace('http://www.w3.org/ns/auth/acl#') // @@ obsolete - use acl:
2020
thisModule.acl = $rdf.Namespace('http://www.w3.org/ns/auth/acl#')
2121
thisModule.arg = $rdf.Namespace('http://www.w3.org/ns/pim/arg#')
2222
thisModule.cal = $rdf.Namespace('http://www.w3.org/2002/12/cal/ical#')
@@ -42,7 +42,7 @@ thisModule.rdf = $rdf.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
4242
thisModule.rdfs = $rdf.Namespace('http://www.w3.org/2000/01/rdf-schema#')
4343
thisModule.rss = $rdf.Namespace('http://purl.org/rss/1.0/')
4444
thisModule.sched = $rdf.Namespace('http://www.w3.org/ns/pim/schedule#')
45-
thisModule.schema = $rdf.Namespace('http:/schema.org/'); // @@ beware confusion with documents no 303
45+
thisModule.schema = $rdf.Namespace('http:/schema.org/') // @@ beware confusion with documents no 303
4646
thisModule.sioc = $rdf.Namespace('http://rdfs.org/sioc/ns#')
4747
// was - thisModule.xsd = $rdf.Namespace('http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dt-')
4848
thisModule.solid = $rdf.Namespace('http://www.w3.org/ns/solid/terms#')

0 commit comments

Comments
 (0)