@@ -1282,7 +1282,7 @@ Parse_stat MCSetOp::parse(MCScriptPoint &sp)
12821282 return PS_NORMAL;
12831283}
12841284
1285- Exec_stat MCSetOp::exec (MCExecPoint &ep )
1285+ void MCSetOp::exec_ctxt (MCExecContext &ctxt )
12861286{
12871287#ifdef /* MCSetOp */ LEGACY_EXEC
12881288 // ARRAYEVAL
@@ -1334,47 +1334,44 @@ Exec_stat MCSetOp::exec(MCExecPoint &ep)
13341334 return ES_NORMAL;
13351335#endif /* MCSetOp */
13361336 // ARRAYEVAL
1337- if (source -> eval (ep) != ES_NORMAL)
1338- {
1339- MCeerror->add (EE_ARRAYOP_BADEXP, line, pos);
1340- return ES_ERROR;
1341- }
1337+ MCAutoValueRef t_src_value;
1338+ if (!ctxt . EvalExprAsValueRef (source, EE_ARRAYOP_BADEXP, &t_src_value))
1339+ return ;
13421340
1343- if (!ep . isarray ())
1344- ep . clear ();
1341+ if (!MCValueIsArray (*t_src_value))
1342+ {
1343+ MCValueRelease (*t_src_value);
1344+ MCValueCopy ((MCValueRef)kMCEmptyString , &t_src_value);
1345+ }
13451346
13461347 MCAutoPointer<MCContainer> t_container;
1347- if (destvar -> evalcontainer (ep , &t_container) != ES_NORMAL )
1348+ if (! destvar -> evalcontainer (ctxt , &t_container))
13481349 {
1349- MCeerror -> add (EE_ARRAYOP_BADEXP, line, pos );
1350- return ES_ERROR ;
1350+ ctxt . LegacyThrow (EE_ARRAYOP_BADEXP );
1351+ return ;
13511352 }
13521353
1353- MCExecPoint ep2 (ep) ;
1354- if (t_container -> eval (ep2) != ES_NORMAL )
1355- return ES_ERROR ;
1354+ MCAutoValueRef t_container_value ;
1355+ if (! t_container -> eval (ctxt, &t_container_value) )
1356+ return ;
13561357
1357- MCAutoArrayRef t_dst_array;
1358- if (!ep2 . copyasmutablearrayref (&t_dst_array))
1359- return ES_ERROR;
1358+ MCAutoArrayRef t_dst_immutable_array;
1359+ MCAutoArrayRef t_dst_array;
1360+ if (!ctxt . ConvertToArray (*t_container_value, &t_dst_immutable_array)
1361+ || !MCArrayMutableCopy (*t_dst_immutable_array, &t_dst_array))
1362+ return ;
13601363
13611364 MCAutoArrayRef t_src_array;
1362- if (!ep . copyasarrayref ( &t_src_array))
1363- return ES_ERROR ;
1365+ if (!ctxt . ConvertToArray (*t_src_value, &t_src_array))
1366+ return ;
13641367
1365- MCExecContext ctxt (ep);
13661368 if (intersect)
13671369 MCArraysExecIntersect (ctxt, *t_dst_array, *t_src_array);
13681370 else
13691371 MCArraysExecUnion (ctxt, *t_dst_array, *t_src_array);
13701372
13711373 if (!ctxt . HasError ())
1372- {
1373- ep2 . setvalueref (*t_dst_array);
1374- return t_container -> set (ep2);
1375- }
1376-
1377- return ES_ERROR;
1374+ t_container -> set (ctxt, *t_dst_array);
13781375}
13791376
13801377void MCSetOp::compile (MCSyntaxFactoryRef ctxt)
0 commit comments