#1 Fix read.location bug

已合并
kjhammerle 6 年之前 将 1 次代码提交从 seyfahni/master合并至 kjhammerle/master

Fixed inconsistency with read.item to throw recoverable IllegalStringLocationException instead of CodeHaltException.

Code like

@is_location_string // (String location)
push(size, location, result);
popArg();

location = popArg();

try {
    read.location(location);
    result = true;
} catch {
    result = false;
}

pushArg(result);

pop("size", "location", "result");
return();

will always return true or halt execution without this fix.

On the other hand, the same code but changed to handle items does work as expected.

@is_item_string // (String item)
push(size, item, result);
popArg();

item = popArg();

try {
    read.item(item);
    result = true;
} catch {
    result = false;
}

pushArg(result);

pop("size", "item", "result");
return();

IllegalStringLocationException should also be renamed to IllegalLocationStringException for further consistency.

Fixed inconsistency with read.item to throw recoverable IllegalStringLocationException instead of CodeHaltException. Code like @is_location_string // (String location) push(size, location, result); popArg(); location = popArg(); try { read.location(location); result = true; } catch { result = false; } pushArg(result); pop("size", "location", "result"); return(); will always return true or halt execution without this fix. On the other hand, the same code but changed to handle items does work as expected. @is_item_string // (String item) push(size, item, result); popArg(); item = popArg(); try { read.item(item); result = true; } catch { result = false; } pushArg(result); pop("size", "item", "result"); return(); IllegalStringLocationException should also be renamed to IllegalLocationStringException for further consistency.
该合并请求已经成功合并!
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
1 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。