Skip to content

Commit cb5f4a8

Browse files
committed
Exec_stat not being returned in new MCChunk::set method
1 parent 048401a commit cb5f4a8

File tree

6 files changed

+14
-21
lines changed

6 files changed

+14
-21
lines changed

engine/src/chunk.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,9 +3281,6 @@ Exec_stat MCChunk::set_legacy(MCExecPoint &ep, Preposition_type ptype)
32813281

32823282
Exec_stat MCChunk::set(MCExecPoint& ep, Preposition_type p_type, MCValueRef p_value)
32833283
{
3284-
//ep . setvalueref(p_value);
3285-
//return set_legacy(ep, p_type);
3286-
32873284
MCExecContext ctxt(ep);
32883285

32893286
if (isvarchunk())
@@ -3330,6 +3327,11 @@ Exec_stat MCChunk::set(MCExecPoint& ep, Preposition_type p_type, MCValueRef p_va
33303327
else
33313328
MCInterfaceExecPutIntoObject(ctxt, *t_string, p_type, t_obj_chunk);
33323329
}
3330+
3331+
if (!ctxt . HasError())
3332+
return ES_NORMAL;
3333+
3334+
return ES_ERROR;
33333335
}
33343336

33353337
#ifdef LEGACY_EXEC

engine/src/cmds.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ Exec_stat MCConvert::exec(MCExecPoint &ep)
359359
else
360360
{
361361
MCDateTimeExecConvert(ctxt, *t_input, fform, fsform, pform, sform, &t_output);
362-
ep . setvalueref(*t_output);
363-
if (container -> set_legacy(ep, PT_INTO) != ES_NORMAL)
362+
if (container -> set(ep, PT_INTO, *t_output) != ES_NORMAL)
364363
{
365364
MCeerror->add(EE_CONVERT_CANTSET, line, pos);
366365
return ES_ERROR;

engine/src/cmdsc.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3434,8 +3434,7 @@ Exec_stat MCReplace::exec(MCExecPoint &ep)
34343434

34353435
if (!ctxt . HasError())
34363436
{
3437-
ep . setvalueref(*t_target);
3438-
return container -> set_legacy(ep, PT_INTO);
3437+
return container -> set(ep, PT_INTO, *t_target);
34393438
}
34403439

34413440
return ctxt . Catch(line, pos);

engine/src/cmdsf.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,8 +1573,7 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
15731573

15741574
if (*t_return_data != nil)
15751575
{
1576-
ep . setvalueref(*t_return_data);
1577-
if (dest->set_legacy(ep, PT_INTO) != ES_NORMAL)
1576+
if (dest->set(ep, PT_INTO, *t_return_data) != ES_NORMAL)
15781577
{
15791578
MCeerror->add(EE_EXPORT_CANTWRITE, line, pos);
15801579
return ES_ERROR;
@@ -1953,8 +1952,7 @@ Exec_stat MCFilter::exec(MCExecPoint &ep)
19531952
MCAutoStringRef t_output;
19541953
MCStringsExecFilter(ctxt, *t_source, *t_pattern, out == True, &t_output);
19551954

1956-
ep . setvalueref(*t_output);
1957-
if (container->set_legacy(ep, PT_INTO) != ES_NORMAL)
1955+
if (container->set(ep, PT_INTO, *t_output) != ES_NORMAL)
19581956
{
19591957
MCeerror->add(EE_FILTER_CANTSET, line, pos);
19601958
return ES_ERROR;

engine/src/cmdsm.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ Exec_stat MCAdd::exec(MCExecPoint &ep)
243243
}
244244
else
245245
{
246-
ep . setvalueref(*t_result);
247-
if (dest->set_legacy(ep, PT_INTO) == ES_NORMAL)
246+
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
248247
return ES_NORMAL;
249248
ctxt . LegacyThrow(EE_ADD_CANTSET);
250249
}
@@ -479,8 +478,7 @@ Exec_stat MCDivide::exec(MCExecPoint &ep)
479478
}
480479
else
481480
{
482-
ep . setvalueref(*t_result);
483-
if (dest->set_legacy(ep, PT_INTO) == ES_NORMAL)
481+
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
484482
return ES_NORMAL;
485483
ctxt . LegacyThrow(EE_DIVIDE_CANTSET);
486484
}
@@ -712,8 +710,7 @@ Exec_stat MCMultiply::exec(MCExecPoint &ep)
712710
}
713711
else
714712
{
715-
ep . setvalueref(*t_result);
716-
if (dest->set_legacy(ep, PT_INTO) == ES_NORMAL)
713+
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
717714
return ES_NORMAL;
718715
ctxt . LegacyThrow(EE_MULTIPLY_CANTSET);
719716
}
@@ -928,8 +925,7 @@ Exec_stat MCSubtract::exec(MCExecPoint &ep)
928925
}
929926
else
930927
{
931-
ep . setvalueref(*t_result);
932-
if (dest->set_legacy(ep, PT_INTO) == ES_NORMAL)
928+
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
933929
return ES_NORMAL;
934930
ctxt . LegacyThrow(EE_SUBTRACT_CANTSET);
935931
}

engine/src/cmdss.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,8 +1922,7 @@ MCCard *cptr = MCcstack->popcard();
19221922
{
19231923
MCAutoStringRef t_element;
19241924
MCInterfaceExecPop(ctxt, &t_element);
1925-
ep . setvalueref(*t_element);
1926-
if (dest->set_legacy(ep, prep) != ES_NORMAL)
1925+
if (dest->set(ep, prep, *t_element) != ES_NORMAL)
19271926
{
19281927
MCeerror->add(EE_POP_CANTSET, line, pos);
19291928
return ES_ERROR;

0 commit comments

Comments
 (0)