Skip to content

Commit 3e16d5c

Browse files
committed
fix dictionary console errors
1 parent 28628a9 commit 3e16d5c

3 files changed

Lines changed: 814 additions & 153 deletions

File tree

mercury_ide/code/mercury.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ const handlers = {
3737
// seperate lines are input as a string of characters
3838
'parse' : (...v) => {
3939
// post('@parse', ...v);
40-
mainParse(v);
40+
// use try catch to make sure the script doesn't crash
41+
// during a performance when errors are typed
42+
try {
43+
mainParse(v);
44+
} catch (e) {
45+
max.post('Unkown error while parsing code');
46+
}
4147

4248
// copy sketch to clipboard for pasting to other editors
4349
if (AUTO_COPY){
@@ -747,7 +753,7 @@ function mainParse(lines){
747753
max.outlet('done');
748754

749755
time = Date.now() - time;
750-
max.post('parsed code succesful within: ' + time + ' ms');
756+
max.post('Parsed code succesful in ' + time + ' ms');
751757
}
752758

753759
const actions = {

mercury_ide/patchers/_mercury_main.maxpat

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48487,13 +48487,25 @@
4848748487
"subpatcher_template" : "",
4848848488
"assistshowspatchername" : 0,
4848948489
"boxes" : [ {
48490+
"box" : {
48491+
"id" : "obj-29",
48492+
"maxclass" : "newobj",
48493+
"numinlets" : 2,
48494+
"numoutlets" : 2,
48495+
"outlettype" : [ "bang", "" ],
48496+
"patching_rect" : [ 229.131942666666646, 243.0, 34.0, 22.0 ],
48497+
"text" : "sel 1"
48498+
}
48499+
48500+
}
48501+
, {
4849048502
"box" : {
4849148503
"id" : "obj-28",
4849248504
"maxclass" : "newobj",
4849348505
"numinlets" : 0,
4849448506
"numoutlets" : 1,
4849548507
"outlettype" : [ "" ],
48496-
"patching_rect" : [ 280.0, 255.0, 60.0, 22.0 ],
48508+
"patching_rect" : [ 280.0, 243.0, 60.0, 22.0 ],
4849748509
"text" : "r INTERP"
4849848510
}
4849948511

@@ -49256,7 +49268,7 @@
4925649268
"numinlets" : 0,
4925749269
"numoutlets" : 1,
4925849270
"outlettype" : [ "" ],
49259-
"patching_rect" : [ 229.131942666666617, 255.0, 45.0, 22.0 ],
49271+
"patching_rect" : [ 229.131942666666646, 212.0, 45.0, 22.0 ],
4926049272
"text" : "r audio"
4926149273
}
4926249274

@@ -49321,7 +49333,7 @@
4932149333
"numinlets" : 1,
4932249334
"numoutlets" : 1,
4932349335
"outlettype" : [ "" ],
49324-
"patching_rect" : [ 122.631942666666674, 285.0, 86.0, 22.0 ],
49336+
"patching_rect" : [ 122.631942666666674, 243.0, 86.0, 22.0 ],
4932549337
"text" : "prepend parse"
4932649338
}
4932749339

@@ -49601,6 +49613,13 @@
4960149613
"source" : [ "obj-28", 0 ]
4960249614
}
4960349615

49616+
}
49617+
, {
49618+
"patchline" : {
49619+
"destination" : [ "obj-25", 0 ],
49620+
"source" : [ "obj-29", 0 ]
49621+
}
49622+
4960449623
}
4960549624
, {
4960649625
"patchline" : {
@@ -49695,7 +49714,7 @@
4969549714
}
4969649715
, {
4969749716
"patchline" : {
49698-
"destination" : [ "obj-25", 0 ],
49717+
"destination" : [ "obj-29", 0 ],
4969949718
"source" : [ "obj-71", 0 ]
4970049719
}
4970149720

0 commit comments

Comments
 (0)