Skip to content

Commit

Permalink
Fix errors in the xpcom/uri module.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Dec 20, 2011
1 parent 288a8dd commit c493edd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/api-utils/lib/xpcom/uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,22 @@
"use strict";

const { Cc, Ci, CC } = require('chrome');
const { newURI } = Cc['@mozilla.org/network/io-service;1'].
getService(Ci.nsIIOService);
const { Unknown } = require('../xpcom');
const { parse } = require('../url');
const { merge } = require('../function');
const { merge } = require('../utils/function');

// Implementation of nsIMutable
const Mutable = Unknown.extend({
interfaces [ 'nsIMutable' ],
interfaces: [ 'nsIMutable' ],
mutable: true
});
exports.Mutable = Mutable;

// Implements base exemplar for a `nsIURI` interface.
const CustomURI = Unknown.extend({
initialize: function initialize(uri) this.merge(parse(uri)),
interfaces: [ 'nsIURI' ],
originCharset: 'UTF-8',
get asciiHost() this.host,
Expand All @@ -60,14 +64,13 @@ const CustomURI = Unknown.extend({
equalsExceptRef: function equalsExceptRef(uri) this.equals(uri),
schemeIs: function schemeIs(scheme) this.scheme === scheme,
resolve: function resolve(path) {
console.log(path)
this.spec + path
return newURI(path, null, newURI(this.spec)).spec;
}
});
exports.CustomURI = CustomURI;

const CustomURL = CustomURI.extend(Mutable, {
initialize: function initialize(uri) this.merge(parse(uri),
initialize: function initialize(uri) this.merge(parse(uri)),
get userPass() this.password,
get filePath() this.filepath,
get fileName() this.filename,
Expand Down

0 comments on commit c493edd

Please sign in to comment.