Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bind_attr_with_hint bugfix and minor optimization to caught exception…
… if/then (converts if ((exc.TargetBlock ~= Block and 1 or 0) ~= 0) then to if (exc.TargetBlock ~= Block) then in generated code)
  • Loading branch information
diakopter committed Nov 6, 2011
1 parent 15602da commit 2f1109b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lua/compiler/PAST2LSTCompiler.pm
Expand Up @@ -428,8 +428,9 @@ our multi sub lst_for(PAST::Block $block) {
$stmts,
LST::Stmts.new(
LST::If.new(
:bool(1),
LST::Literal.new(
:value("(exc.TargetBlock ~= Block and 1 or 0)")
:value("exc.TargetBlock ~= Block")
),
LST::Throw.new()
),
Expand Down
2 changes: 1 addition & 1 deletion lua/runtime/Metamodel/KnowHOW/KnowHOWREPR.lua
Expand Up @@ -22,7 +22,7 @@ function makeKnowHOWREPR ()
return setmetatable(this, mt);
end
function KnowHOWREPR:type_object_for(TC, MetaPackage)
local STable = SharedTable.new();
local STable = SharedTable.new();
STable.HOW = MetaPackage;
STable.REPR = self;
STable.WHAT = Instance.new(STable);
Expand Down
2 changes: 1 addition & 1 deletion lua/runtime/Runtime/Ops/Metamodel.lua
Expand Up @@ -35,7 +35,7 @@ function Ops.bind_attr_with_hint(TC, Object, Class, Name, Value, Hint)
if (Name.Value ~= nil) then
Name = Ops.unbox_str(TC, Name);
end
Object.STable.REPR:bind_attribute_with_hint(TC, Object, Class, Name, Value);
Object.STable.REPR:bind_attribute_with_hint(TC, Object, Class, Name, Hint, Value);
return Value;
end

Expand Down

0 comments on commit 2f1109b

Please sign in to comment.