Add unique ID for Targets

This commit is contained in:
Tim Mickel 2016-08-31 11:39:57 -04:00
parent b1a3026ea1
commit 2c6722b958

View file

@ -1,4 +1,5 @@
var Blocks = require('./blocks'); var Blocks = require('./blocks');
var uid = require('../util/uid');
/** /**
* @fileoverview * @fileoverview
@ -14,6 +15,15 @@ function Target (blocks) {
if (!blocks) { if (!blocks) {
blocks = new Blocks(this); blocks = new Blocks(this);
} }
/**
* A unique ID for this target.
* @type {string}
*/
this.id = uid();
/**
* Blocks run as code for this target.
* @type {!Blocks}
*/
this.blocks = blocks; this.blocks = blocks;
} }