mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 00:34:22 +02:00
Added script that lists the current JS API
This commit is contained in:
parent
c3b87504d9
commit
9ca80cf4b3
1 changed files with 31 additions and 0 deletions
31
examples/currentAPI.js
Normal file
31
examples/currentAPI.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// currentAPI.js
|
||||
// examples
|
||||
//
|
||||
// Created by Clément Brisset on 5/30/14.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
|
||||
function listKeys(string, object) {
|
||||
if (typeof(object) != "object") {
|
||||
print(typeof(object) + " " + string);
|
||||
return;
|
||||
}
|
||||
|
||||
var keys = Object.keys(object);
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
if (string == "listKeys") {
|
||||
return;
|
||||
} else if (string == "") {
|
||||
listKeys(keys[i], object[keys[i]]);
|
||||
} else {
|
||||
listKeys(string + "." + keys[i], object[keys[i]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listKeys("", this);
|
Loading…
Reference in a new issue