Skip to content

Commit 85ffb4e

Browse files
author
Ali Lloyd
committed
removed ep from property setting routine
1 parent 0a69715 commit 85ffb4e

File tree

15 files changed

+891
-404
lines changed

15 files changed

+891
-404
lines changed

engine/src/chunk.cpp

Lines changed: 120 additions & 267 deletions
Large diffs are not rendered by default.

engine/src/chunk.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MCChunk : public MCExpression
6161
~MCChunk();
6262

6363
Parse_stat parse(MCScriptPoint &spt, Boolean the);
64-
Exec_stat eval(MCExecPoint &);
64+
//Exec_stat eval(MCExecPoint &);
6565
void eval_ctxt(MCExecContext &ctxt, MCExecValue& r_value);
6666

6767
#ifdef LEGACY_EXEC
@@ -122,7 +122,7 @@ class MCChunk : public MCExpression
122122

123123
#endif
124124
/* WRAPPER */ Exec_stat set(MCExecPoint& ep, Preposition_type p_type, MCValueRef p_text);
125-
void set(MCExecContext& ctxt, Preposition_type p_type, MCValueRef p_value);
125+
bool set(MCExecContext& ctxt, Preposition_type p_type, MCValueRef p_value);
126126
#ifdef LEGACY_EXEC
127127
Exec_stat gets(MCExecPoint &);
128128
Exec_stat set_legacy(MCExecPoint &, Preposition_type ptype);
@@ -141,16 +141,18 @@ class MCChunk : public MCExpression
141141

142142
// MW-2011-11-23: [[ Array Chunk Props ]] If index is not nil, then treat as an array chunk prop
143143
Exec_stat getprop(Properties w, MCExecPoint &, MCNameRef index, Boolean effective);
144-
#endif
144+
145145
Exec_stat setprop(Properties w, MCExecPoint &, MCNameRef index, Boolean effective);
146-
146+
#endif
147+
147148
bool getprop(MCExecContext& ctxt, Properties which, MCNameRef index, Boolean effective, MCExecValue& r_value);
149+
bool setprop(MCExecContext& ctxt, Properties which, MCNameRef index, Boolean effective, MCExecValue p_value);
148150

149151
#ifdef LEGACY_EXEC
150152
Exec_stat getprop_legacy(Properties w, MCExecPoint &, MCNameRef index, Boolean effective);
151153
Exec_stat setprop_legacy(Properties w, MCExecPoint &, MCNameRef index, Boolean effective);
152-
#endif
153154
Exec_stat getobjforprop(MCExecPoint& ep, MCObject*& r_object, uint4& r_parid);
155+
#endif
154156
bool getobjforprop(MCExecContext& ctxt, MCObject*& r_object, uint4& r_parid);
155157
// REMOVE: Exec_stat select(MCExecPoint &, Preposition_type where, Boolean text, Boolean first);
156158
#ifdef LEGACY_EXEC

engine/src/cmds.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,14 +1333,7 @@ void MCPut::exec_ctxt(MCExecContext& ctxt)
13331333
return ES_NORMAL;
13341334
}
13351335
#endif /* MCPut */
1336-
1337-
1338-
if (line == 284 && pos == 1)
1339-
{
1340-
bool t_true = true;
1341-
}
1342-
1343-
1336+
13441337

13451338
MCAutoValueRef t_value;
13461339
if (!ctxt . EvalExprAsValueRef(source, EE_PUT_BADEXP, &t_value))

engine/src/cmdsc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3277,7 +3277,8 @@ Exec_stat MCReplace::exec(MCExecPoint &ep)
32773277

32783278
if (!ctxt . HasError())
32793279
{
3280-
return container -> set(ep, PT_INTO, *t_target);
3280+
if (container -> set(ctxt, PT_INTO, *t_target))
3281+
return ES_NORMAL;
32813282
}
32823283

32833284
return ctxt . Catch(line, pos);

engine/src/cmdsm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Exec_stat MCAdd::exec(MCExecPoint &ep)
244244
}
245245
else
246246
{
247-
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
247+
if (dest->set(ctxt, PT_INTO, *t_result))
248248
return ES_NORMAL;
249249
ctxt . LegacyThrow(EE_ADD_CANTSET);
250250
}
@@ -479,7 +479,7 @@ Exec_stat MCDivide::exec(MCExecPoint &ep)
479479
}
480480
else
481481
{
482-
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
482+
if (dest->set(ctxt, PT_INTO, *t_result) == ES_NORMAL)
483483
return ES_NORMAL;
484484
ctxt . LegacyThrow(EE_DIVIDE_CANTSET);
485485
}
@@ -711,7 +711,7 @@ Exec_stat MCMultiply::exec(MCExecPoint &ep)
711711
}
712712
else
713713
{
714-
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
714+
if (dest->set(ctxt, PT_INTO, *t_result))
715715
return ES_NORMAL;
716716
ctxt . LegacyThrow(EE_MULTIPLY_CANTSET);
717717
}
@@ -926,7 +926,7 @@ Exec_stat MCSubtract::exec(MCExecPoint &ep)
926926
}
927927
else
928928
{
929-
if (dest->set(ep, PT_INTO, *t_result) == ES_NORMAL)
929+
if (dest->set(ctxt, PT_INTO, *t_result))
930930
return ES_NORMAL;
931931
ctxt . LegacyThrow(EE_SUBTRACT_CANTSET);
932932
}

engine/src/cmdss.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ MCCard *cptr = MCcstack->popcard();
19271927
{
19281928
MCAutoStringRef t_element;
19291929
MCInterfaceExecPop(ctxt, &t_element);
1930-
if (dest->set(ep, prep, *t_element) != ES_NORMAL)
1930+
if (dest->set(ctxt, prep, *t_element))
19311931
{
19321932
MCeerror->add(EE_POP_CANTSET, line, pos);
19331933
return ES_ERROR;

engine/src/exec-engine.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,12 @@ void MCEngineEvalValueWithObject(MCExecContext& ctxt, MCStringRef p_script, MCOb
631631

632632
void MCEngineExecSet(MCExecContext& ctxt, MCProperty *p_target, MCValueRef p_value)
633633
{
634-
/* UNCHECKED */ ctxt . GetEP() . setvalueref(p_value);
635-
if (p_target -> set(ctxt . GetEP()) != ES_NORMAL)
634+
MCExecValue t_value;
635+
t_value . valueref_value = MCValueRetain(p_value);
636+
t_value . type = kMCExecValueTypeValueRef;
637+
638+
p_target -> set(ctxt, t_value);
639+
if (ctxt . HasError())
636640
{
637641
ctxt . LegacyThrow(EE_SET_BADSET);
638642
return;

0 commit comments

Comments
 (0)