Mercurial > spidermonkey-playground
comparison memory_profiler_server.js @ 54:c451579bf83c
Built out more of the /objects/ method.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Wed, 24 Jun 2009 18:15:03 -0700 |
parents | 2b22291fa09a |
children | 4910bc49a182 |
comparison
equal
deleted
inserted
replaced
53:2b22291fa09a | 54:c451579bf83c |
---|---|
46 toSend = JSON.stringify(getGCRoots()); | 46 toSend = JSON.stringify(getGCRoots()); |
47 | 47 |
48 if (path == "/stop") | 48 if (path == "/stop") |
49 toSend = "Stopping server now!"; | 49 toSend = "Stopping server now!"; |
50 | 50 |
51 var objNum = path.match(/^\/objects\/(.+)$/); | 51 var objNum = path.match(/^\/objects\/(\d+)$/); |
52 if (objNum) { | 52 if (objNum) { |
53 objNum = objNum[1]; | 53 objNum = objNum[1]; |
54 toSend = "TODO: Put object information here."; | 54 var objInfo = getObjectInfo(objNum); |
55 if (objInfo) { | |
56 toSend = JSON.stringify(objInfo); | |
57 } else { | |
58 code = "404 Not Found"; | |
59 toSend = "Object " + objNum + " does not exist."; | |
60 } | |
55 } | 61 } |
56 | 62 |
57 if (!toSend) { | 63 if (!toSend) { |
58 code = "404 Not Found"; | 64 code = "404 Not Found"; |
59 toSend = "Not found, yo."; | 65 toSend = "Not found, yo."; |