Update core.js

Fixed constructor logic when not using the `new` keyword during
instantiation.