unexpected
Advanced tools
Comparing version 5.0.0-beta7 to 5.0.0-beta8
@@ -559,3 +559,2 @@ var utils = require('./utils'); | ||
inspect: function (f, depth, output, inspect) { | ||
var ownPropertyNames = Object.keys(f); | ||
var source = f.toString(); | ||
@@ -587,20 +586,3 @@ var name; | ||
} | ||
if (ownPropertyNames.length > 0 && !name) { | ||
name = 'f'; | ||
} | ||
output.code('function ' + name + '(' + args + ') {' + body + '}', 'javascript'); | ||
if (ownPropertyNames.length > 0) { | ||
var propertiesOutput = output.clone(); | ||
ownPropertyNames.forEach(function (ownPropertyName, i) { | ||
propertiesOutput | ||
.nl(i > 0 ? 1 : 0) | ||
.code(name + (/^[a-z\$\_][a-z0-9\$\_]*$/i.test(ownPropertyName) ? | ||
'.' + ownPropertyName : | ||
"['" + ownPropertyName.replace(/'/g, "\\'") + "']") + ' = ', 'javascript') | ||
.append(inspect(f[ownPropertyName])) | ||
.code(';', 'javascript'); | ||
}); | ||
output.nl().append(propertiesOutput.prependLinesWith('comment', '// ')); | ||
output = output.clone().block(output); | ||
} | ||
return output; | ||
@@ -607,0 +589,0 @@ } |
{ | ||
"name": "unexpected", | ||
"version": "5.0.0-beta7", | ||
"version": "5.0.0-beta8", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1140185
10535