From aa37e5483b5f86d8b8c6a803acf5bb68f37ae022 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Jul 2005 10:39:16 +0000 Subject: r8240: support comparing pointers in ejs. This allows for if (io.output.samr == NULL) { print("no result\n"); } (This used to be commit 89db5c68a5ee6875ccddcfe70a6e1232b40039b3) --- source4/lib/ejs/ejsParser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib/ejs') diff --git a/source4/lib/ejs/ejsParser.c b/source4/lib/ejs/ejsParser.c index 8d0aa7ba2c..57cb569cdb 100644 --- a/source4/lib/ejs/ejsParser.c +++ b/source4/lib/ejs/ejsParser.c @@ -1659,10 +1659,13 @@ static int evalExpr(Ejs *ep, MprVar *lhs, int rel, MprVar *rhs) case MPR_TYPE_CFUNCTION: case MPR_TYPE_FUNCTION: case MPR_TYPE_OBJECT: - case MPR_TYPE_PTR: mprCopyVarValue(&ep->result, mprCreateBoolVar(0), 0); return 0; + case MPR_TYPE_PTR: + mprCopyVarValue(&ep->result, mprCreateBoolVar(lhs->ptr == rhs->ptr), 0); + return 0; + case MPR_TYPE_BOOL: rc = evalBoolExpr(ep, lhs->boolean, rel, rhs->boolean); break; -- cgit