determine _pushThread defaults without Object.assign

This commit is contained in:
Michael "Z" Goddard 2019-01-18 17:20:06 -05:00
parent 9135780c55
commit c3f9e0945b
No known key found for this signature in database
GPG key ID: 762CD40DD5349872

View file

@ -1434,16 +1434,11 @@ class Runtime extends EventEmitter {
* @return {!Thread} The newly created thread. * @return {!Thread} The newly created thread.
*/ */
_pushThread (id, target, opts) { _pushThread (id, target, opts) {
opts = Object.assign({
stackClick: false,
updateMonitor: false
}, opts);
const thread = new Thread(id); const thread = new Thread(id);
thread.target = target; thread.target = target;
thread.stackClick = opts.stackClick; thread.stackClick = Boolean(opts && opts.stackClick);
thread.updateMonitor = opts.updateMonitor; thread.updateMonitor = Boolean(opts && opts.updateMonitor);
thread.blockContainer = opts.updateMonitor ? thread.blockContainer = thread.updateMonitor ?
this.monitorBlocks : this.monitorBlocks :
target.blocks; target.blocks;