1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-19 04:23:48 +03:00

r11458: fixed our ejs smbscript interfaces to use arrays where appropriate. In

js arrays are a special type of object where the length property is
automatic, and cannot be modified manually. Our code was manually
setting length, which made it abort when someone passed in a real ejs
array. To fix this we need to create real arrays instead of objects,
and remove the code that manually sets the length
This commit is contained in:
Andrew Tridgell
2005-11-02 01:04:00 +00:00
committed by Gerald (Jerry) Carter
parent 46e91f269c
commit ebdd1393fd
8 changed files with 48 additions and 42 deletions

View File

@@ -51,16 +51,13 @@ function __winreg_open_path(path)
{
var s = string_init();
var i, components = s.split('\\', path);
var list = new Object();
list.length = 0;
/* cope with a leading slash */
if (components[0] == '') {
for (i=0;i<(components.length-1);i++) {
components[i] = components[i+1];
}
components.length--;
delete(components[i]);
}
if (components.length == 0) {
@@ -108,8 +105,7 @@ function __winreg_open_path(path)
*/
function __winreg_enum_path(path)
{
var list = new Object();
list.length = 0;
var list = new Array(0);
if (path == null || path == "\\" || path == "") {
return new Array("HKLM", "HKU");
@@ -155,7 +151,6 @@ function __winreg_enum_path(path)
return list;
}
list[list.length] = out.name.name;
list.length++;
}
this.close(handle);
@@ -174,8 +169,7 @@ function __winreg_enum_path(path)
function __winreg_enum_values(path)
{
var data = datablob_init();
var list = new Object();
list.length = 0;
var list = new Array(0);
var handle = this.open_path(path);
if (handle == undefined) {
@@ -224,7 +218,6 @@ function __winreg_enum_values(path)
el.value = data.regToVar(el.rawvalue, el.type);
el.size = out.size;
list[list.length] = el;
list.length++;
}
this.close(handle);