schema-object icon indicating copy to clipboard operation
schema-object copied to clipboard

Traceback thrown in SchemaArray.map with Node 6.x

Open rconnamacher opened this issue 7 years ago • 1 comments

I'm getting a traceback when running on Node 6.10.1, but not on Node 4.x.

const SchemaObject = require('schema-object');
const Foo = new SchemaObject({
    name: {type: String}
});
const FooGroup = new SchemaObject({
    foos: {type: [Foo]}
});

const fooGroup = new FooGroup({
    foos: [{
        name: "Foo 1"
    }]
});

fooGroup.foos.map(foo => foo);
// Boom, see traceback below...
TypeError: Cannot read property 'arrayType' of undefined
    at new SchemaArray ([...]/node_modules/schema-object/dist/schemaobject.js:559:27)
    at SchemaArray.map (native)
    at repl:1:15
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:73:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:538:10)

rconnamacher avatar Mar 30 '17 19:03 rconnamacher

@rconnamacher I'm looking into it. Thanks for the report.

scotthovestadt avatar Mar 30 '17 20:03 scotthovestadt