Basic question... shouldn't the current map-execut...
# suitescript
w
Basic question... shouldn't the current map-execution be aborted when I "return"?
Copy code
map(){
try{
  if(condition) return; //<---
  other code thar shouldn't be executed...
}catch {}

context.write({})
}
s
Yes, unless an exception is thrown prior (or during) evaluation of the
condition
w
Thanks, needed a sanity-check.
...silly me. I'm writing an allocation script that performs a search to check if the current line already has been allocated. My way of testing this was to execute the script two times, expecting the second time to be empty. Buuut, the second time it allocated the result from the first execution.
facepalm 1
s
Aye, if it's any consolation, I've never seen NS misbehave from a pure programming language perspective.
😂 1