use Node.js shims

This commit is contained in:
Jeff Williams 2012-11-05 19:27:27 -08:00
parent 1c1ce62a0e
commit 81a8a81526
2 changed files with 7 additions and 6 deletions

View File

@ -7,6 +7,8 @@
@license Apache License 2.0 - See file 'LICENSE.md' in this project.
*/
var path = require('path');
/** @private */
function setDocletKindToTitle(doclet, tag) {
doclet.addTag( 'kind', tag.title );
@ -33,9 +35,8 @@ function setDocletDescriptionToValue(doclet, tag) {
function setNameToFile(doclet, tag) {
if (doclet.meta.filename) {
var name = 'file:';
if (doclet.meta.path) { name += doclet.meta.path + java.lang.System.getProperty("file.separator"); }
doclet.addTag( 'name', name + doclet.meta.filename );
var name = doclet.meta.path || '';
doclet.addTag( 'name', path.join(name, doclet.meta.filename) );
}
}
@ -60,7 +61,8 @@ function applyNamespace(docletOrNs, tag) {
}
function setDocletNameToFilename(doclet, tag) {
var name = (doclet.meta.path ? (doclet.meta.path + java.lang.System.getProperty("file.separator")) : "") + doclet.meta.filename;
var name = doclet.meta.path || '';
name = path.join(name, doclet.meta.filename);
name = name.replace(/\.js$/i, '');
for (var i = 0, len = env.opts._.length; i < len; i++) {

View File

@ -1,6 +1,5 @@
var isWindows = java.lang.System.getProperty("os.name").toLowerCase().contains("windows");
var fileSeparator = exports.sep = java.lang.System.getProperty("file.separator");
var fileSeparator = exports.sep = String( java.lang.System.getProperty("file.separator") );
/**
* Returns everything on a path except for the last item