Skip to content

Commit 87092ac

Browse files
committed
[js] Implement nqp::objectid.
1 parent 4345f11 commit 87092ac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/vm/js/QAST/Compiler.nqp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ class QAST::OperationsJS {
14241424
add_simple_op('composetype', $T_OBJ, [$T_OBJ, $T_OBJ], :sideffects);
14251425

14261426
add_simple_op('where', $T_INT, [$T_OBJ]);
1427+
add_simple_op('objectid', $T_INT, [$T_OBJ]);
14271428

14281429
# HACK
14291430
# TODO think what we should return on 1.WHAT and "foo".WHAT

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@ op.where = function(obj) {
406406
}
407407
return obj._WHERE;
408408
} else {
409-
throw 'WHERE on this type of thing unimplemented';
409+
throw 'WHERE/objectid on this type of thing unimplemented';
410410
}
411411
};
412412

413+
op.objectid = op.where;
413414

414415
/* HACK - take the current HLL settings into regard */
415416

0 commit comments

Comments
 (0)