summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-06-04 03:32:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:33 -0500
commitb1243510793cd135f1464dcfeec0b7e88999d1a0 (patch)
tree960539c5792f72d5354cb03abc8b10a9f011dc8b /source4/scripting/ejs
parent6ade5fc245a6f56b991b1b66742509270d65479d (diff)
downloadsamba-b1243510793cd135f1464dcfeec0b7e88999d1a0.tar.gz
samba-b1243510793cd135f1464dcfeec0b7e88999d1a0.tar.bz2
samba-b1243510793cd135f1464dcfeec0b7e88999d1a0.zip
r7261: Pass by reference is done in js via MPR_TYPE_OBJECT. Update argument
parsing and example for resolveName(). (This used to be commit 1a4a54931733ebfa743401a184fe460c044427b4)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/smbcalls.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c
index 5d4c61b04b..93496bd9c9 100644
--- a/source4/scripting/ejs/smbcalls.c
+++ b/source4/scripting/ejs/smbcalls.c
@@ -271,6 +271,11 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv)
goto done;
}
+ if (argv[0]->type != MPR_TYPE_OBJECT) {
+ ejsSetErrorMsg(eid, "resolvename invalid arguments");
+ goto done;
+ }
+
if (argv[1]->type != MPR_TYPE_STRING) {
ejsSetErrorMsg(eid, "resolveName invalid arguments");
goto done;
@@ -291,8 +296,8 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv)
nt_status = resolve_name(&name, tmp_ctx, &reply_addr);
if (NT_STATUS_IS_OK(nt_status)) {
- mprDestroyAllVars(argv[0]);
- *argv[0] = mprCreateStringVar(reply_addr, True);
+ mprSetPropertyValue(argv[0], "value",
+ mprCreateStringVar(reply_addr, 1));
}
ejsSetReturnValue(eid, mprNTSTATUS(nt_status));