summaryrefslogtreecommitdiff
path: root/byob.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-06-06 13:32:59 +0200
committerjmoenig <jens@moenig.org>2013-06-06 13:32:59 +0200
commita2094b033e1e22cf64c0bdd1503714db5503489b (patch)
treec9f30534f454469d60025cdffa03b63bb16903d6 /byob.js
parent12ba9b7703075d08710aef9718c86c441b775108 (diff)
downloadsnap-byow-a2094b033e1e22cf64c0bdd1503714db5503489b.tar.gz
snap-byow-a2094b033e1e22cf64c0bdd1503714db5503489b.zip
BYOB: Newly created custom reporters now have an initial default REPORT block as definition body
Diffstat (limited to 'byob.js')
-rw-r--r--byob.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/byob.js b/byob.js
index 7fbe3e1..b9797e3 100644
--- a/byob.js
+++ b/byob.js
@@ -105,7 +105,7 @@ CommentMorph, localize, CSlotMorph, SpeechBubbleMorph, MorphicPreferences*/
// Global stuff ////////////////////////////////////////////////////////
-modules.byob = '2013-May-16';
+modules.byob = '2013-June-06';
// Declarations
@@ -1336,7 +1336,7 @@ BlockDialogMorph.prototype.setScope = function (varType) {
// other ops
BlockDialogMorph.prototype.getInput = function () {
- var spec, def;
+ var spec, def, body;
if (this.body instanceof InputFieldMorph) {
spec = this.normalizeSpaces(this.body.getValue());
}
@@ -1344,6 +1344,16 @@ BlockDialogMorph.prototype.getInput = function () {
def.type = this.blockType;
def.category = this.category;
def.isGlobal = this.isGlobal;
+ if (def.type === 'reporter' || def.type === 'predicate') {
+ body = Process.prototype.reify.call(
+ null,
+ SpriteMorph.prototype.blockForSelector('doReport'),
+ new List(),
+ true // ignore empty slots for custom block reification
+ );
+ body.outerContext = null;
+ def.body = body;
+ }
return def;
};