fixed lint spaces/indentation errors

This commit is contained in:
Stephen Ward 2018-09-24 17:46:01 -04:00
parent add00ce563
commit e7811eb53b
2 changed files with 13 additions and 13 deletions

View File

@ -1623,15 +1623,15 @@ function open(fs, context, path, flags, mode, callback) {
* callback = makeCallback(callback); * callback = makeCallback(callback);
* } * }
*/ */
if (arguments.length == 5){ if (arguments.length == 5){
callback = arguments[arguments.length - 1]; callback = arguments[arguments.length - 1];
} }
else { else {
//need to test this validateAndMakeMode //need to test this validateAndMakeMode
console.log("open'd mode: " + mode) console.log('open\'d mode: ' + mode);
mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback); mode = validateAndMaskMode(mode, FULL_READ_WRITE_EXEC_PERMISSIONS, callback);
console.log("mask'd mode: " + mode) console.log('mask\'d mode: ' + mode);
} }
if(!pathCheck(path, callback)) return; if(!pathCheck(path, callback)) return;
@ -1921,7 +1921,7 @@ function isUint32(value) {
// Validator for mode_t (the S_* constants). Valid numbers or octal strings // Validator for mode_t (the S_* constants). Valid numbers or octal strings
// will be masked with 0o777 to be consistent with the behavior in POSIX APIs. // will be masked with 0o777 to be consistent with the behavior in POSIX APIs.
function validateAndMaskMode(value, def, callback) { function validateAndMaskMode(value, def, callback) {
console.log("Passed in mode: " + value) console.log('Passed in mode: ' + value);
if(typeof def === 'function') { if(typeof def === 'function') {
callback = def; callback = def;
def = undefined; def = undefined;
@ -1929,7 +1929,7 @@ function validateAndMaskMode(value, def, callback) {
if (isUint32(value)) { if (isUint32(value)) {
let newMode = value & FULL_READ_WRITE_EXEC_PERMISSIONS; let newMode = value & FULL_READ_WRITE_EXEC_PERMISSIONS;
console.log("Masked mode: " + newMode) console.log('Masked mode: ' + newMode);
return value & FULL_READ_WRITE_EXEC_PERMISSIONS; return value & FULL_READ_WRITE_EXEC_PERMISSIONS;
} }
@ -1950,7 +1950,7 @@ function validateAndMaskMode(value, def, callback) {
return false; return false;
} }
var parsed = parseInt(value, 8); var parsed = parseInt(value, 8);
console.log("Parsed + Masekd mode: " + parsed & FULL_READ_WRITE_EXEC_PERMISSIONS) console.log('Parsed + Masekd mode: ' + parsed & FULL_READ_WRITE_EXEC_PERMISSIONS);
return parsed & FULL_READ_WRITE_EXEC_PERMISSIONS; return parsed & FULL_READ_WRITE_EXEC_PERMISSIONS;
} }

View File

@ -117,7 +117,7 @@ describe('fs.open', function() {
expect(result).to.exist; expect(result).to.exist;
expect(result.type).to.equal('FILE'); expect(result.type).to.equal('FILE');
expect(result.mode).to.exist; expect(result.mode).to.exist;
expect(result.mode).to.equal(33188) expect(result.mode).to.equal(33188);
done(); done();
}); });
}); });