Skip to content

Commit fa6709e

Browse files
committed
Pass test 73.
Implement associative_delegate.
1 parent 22a103c commit fa6709e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/vm/js/bin/run_tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
# 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped
3-
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,75,76,78,79,81,83,88,89,90,91,92,93,94,95}* t/js/getcomp-js.t t/qast/02*
3+
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,73,75,76,78,79,81,83,88,89,90,91,92,93,94,95}* t/js/getcomp-js.t t/qast/02*

src/vm/js/nqp-runtime/reprs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ P6opaque.prototype.deserialize_repr_data = function(cursor, STable) {
116116
if (this.positional_delegate_slot != -1) {
117117
STable.setPositionalDelegate(slots[this.positional_delegate_slot]);
118118
}
119+
if (this.associative_delegate_slot != -1) {
120+
STable.setAssociativeDelegate(slots[this.associative_delegate_slot]);
121+
}
119122

120-
/* TODO make possitional and associative delegates work */
121123
/* TODO make auto viv values work */
122124
};
123125

src/vm/js/nqp-runtime/sixmodel.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,16 @@ STable.prototype.setPositionalDelegate = function(attr) {
8585
this.obj_constructor.prototype.$$atpos = function(index) {
8686
return this[attr][index];
8787
};
88+
};
8889

90+
// TODO handle attrs properly
91+
STable.prototype.setAssociativeDelegate = function(attr) {
92+
this.obj_constructor.prototype.$$bindkey = function(key, value) {
93+
return this[attr].$$bindkey(key, value);
94+
};
95+
this.obj_constructor.prototype.$$atkey = function(key) {
96+
return this[attr].$$atkey(key);
97+
};
8998
};
9099

91100
module.exports.STable = STable;

0 commit comments

Comments
 (0)