Skip to content

Commit 0001e13

Browse files
committed
Few attribute fixes.
1 parent c138dfb commit 0001e13

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/HLL/World.pm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ class HLL::World {
4848
# XXX LEGACY
4949
has %!addr_to_slot;
5050

51-
method new(:$handle!, :$description = '<unknown>') {
52-
my $obj := self.CREATE();
53-
$obj.BUILD(:handle($handle), :description($description));
54-
$obj
55-
}
56-
5751
method BUILD(:$handle!, :$description!) {
5852
# Initialize attributes.
5953
$!sc := pir::nqp_create_sc__PS($handle);

src/NQPQ/World.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ class NQP::World is HLL::World {
2020
# Mapping of sub IDs to SC indexes of code stubs.
2121
has %!code_stub_sc_idx;
2222

23+
method BUILD(*%opts) {
24+
@!BLOCKS := nqp::list();
25+
%!code_objects_to_fix_up := nqp::hash();
26+
%!code_object_fixup_list := nqp::hash();
27+
%!code_stub_sc_idx := nqp::hash();
28+
}
29+
2330
# Creates a new lexical scope and puts it on top of the stack.
2431
method push_lexpad($/) {
2532
# Create pad, link to outer and add to stack.

src/QAST/Block.nqp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class QAST::Block is QAST::Node {
2929
}
3030

3131
method symbol($name, *%attrs) {
32+
%!symbol := nqp::hash() if nqp::isnull(%!symbol);
3233
if %attrs {
3334
%!symbol{$name} := %!symbol{$name} // {};
3435
for %attrs {
@@ -39,6 +40,7 @@ class QAST::Block is QAST::Node {
3940
}
4041

4142
method symtable() {
43+
%!symbol := nqp::hash() if nqp::isnull(%!symbol);
4244
%!symbol
4345
}
4446
}

0 commit comments

Comments
 (0)