From 91dd06ea9a2aafddd3db03618cca06640fea9c83 Mon Sep 17 00:00:00 2001 From: Pawel Murias Date: Mon, 7 Nov 2016 12:07:02 +0100 Subject: [PATCH] [js] Fix some bugs after null -> Null transition. --- src/vm/js/Perl6/Ops.nqp | 2 +- src/vm/js/perl6-runtime/runtime.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vm/js/Perl6/Ops.nqp b/src/vm/js/Perl6/Ops.nqp index 23cd784ae33..7de9762b94d 100644 --- a/src/vm/js/Perl6/Ops.nqp +++ b/src/vm/js/Perl6/Ops.nqp @@ -43,7 +43,7 @@ $ops.add_op('p6bindsig', :!inlinable, sub ($comp, $node, :$want, :$cps) { my $tmp := $*BLOCK.add_tmp; $ops.new_chunk($ops.VOID, "", [ "$tmp = nqp.p6binder.bind_sig($*CTX, null, nqp.p6binder, nqp.op.savecapture(Array.prototype.slice.call(arguments)));\n", - "if ($tmp !== null) return $tmp;\n" + "if ($tmp !== Null) return $tmp;\n" ]); }); diff --git a/src/vm/js/perl6-runtime/runtime.js b/src/vm/js/perl6-runtime/runtime.js index 1c78c8ae5bc..e80a9627844 100644 --- a/src/vm/js/perl6-runtime/runtime.js +++ b/src/vm/js/perl6-runtime/runtime.js @@ -1,4 +1,5 @@ var nqp = require('nqp-runtime'); +var Null = nqp.Null; var CodeRef = require('nqp-runtime/code-ref'); var NQPArray = require('nqp-runtime/array'); var op = {}; @@ -59,7 +60,7 @@ op.p6box_s = function(str) { op.p6captureouters2 = function(ctx, capList, target) { var cf = (target.outerCtx || closure.forcedOuter); - if (cf === null) { + if (cf === Null) { return capList; } @@ -106,7 +107,7 @@ op.p6capturelex = function(ctx, codeObj) { }; op.p6var = function(cont) { - if (cont != null && cont.$$iscont && cont.$$iscont()) { + if (cont.$$iscont && cont.$$iscont()) { var wrapper = Scalar._STable.REPR.allocate(Scalar._STable); wrapper.$$bindattr(Scalar, '$!value', cont); return wrapper;