Skip to content

Commit 69745df

Browse files
committed
Added basename to URI class.
1 parent d93f802 commit 69745df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/scripts/uri.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ var URIPrototype = function(uri_prop_name)
104104

105105
this.__defineSetter__("dir_pathname", function() {});
106106

107+
this.__defineGetter__("basename", function()
108+
{
109+
return this.filename || this.dir_pathname;
110+
});
111+
112+
this.__defineSetter__("basename", function() {});
113+
107114
this.__defineGetter__("abs_dir", function()
108115
{
109116
if (this._abs_dir === undefined && (this._is_parsed || this[uri_prop_name]))

0 commit comments

Comments
 (0)