Bläddra i källkod

refs #1004. Adds test cases, minor bug fixes.

http://source.rd.rcg.local/trac/eagle6/changeset/1341/Eagle6_SVN
Jared Hall 13 år sedan
förälder
incheckning
2599fe11da
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      lib/pipeline/documentSources/ProjectDocumentSource.js

+ 2 - 2
lib/pipeline/documentSources/ProjectDocumentSource.js

@@ -95,7 +95,7 @@ var ProjectDocumentSource = module.exports = (function(){
 	 * @return a ProjectDocumentSource instance
 	**/
 	klass.createFromJson = function(jsonElement, expCtx) {
-		if(! jsonElement instanceof Object) {
+		if(jsonElement instanceof Object && jsonElement.constructor === Object) {
 			throw new Error('Error 15969. Specification must be an object but was ' + typeof jsonElement);
 		}
 		var objectContext = Expression.ObjectCtx({
@@ -106,7 +106,7 @@ var ProjectDocumentSource = module.exports = (function(){
 		var project = new ProjectDocumentSource();
 		var parsed = Expression.parseObject(jsonElement, objectContext);
 		var exprObj = parsed; 
-		if(!exprObj) {
+		if(! exprObj instanceof ObjectExpression) {
 			throw new Error("16402, parseObject() returned wrong type of Expression");
 		}
 		if(!exprObj.getFieldCount()) {