|
|
@@ -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()) {
|