OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 function Stringify(x, depth) { | 2203 function Stringify(x, depth) { |
2204 if (depth === undefined) | 2204 if (depth === undefined) |
2205 depth = stringifyDepthLimit; | 2205 depth = stringifyDepthLimit; |
2206 else if (depth === 0) | 2206 else if (depth === 0) |
2207 return "*"; | 2207 return "*"; |
2208 switch (typeof x) { | 2208 switch (typeof x) { |
2209 case "undefined": | 2209 case "undefined": |
2210 return "undefined"; | 2210 return "undefined"; |
2211 case "boolean": | 2211 case "boolean": |
2212 case "number": | 2212 case "number": |
| 2213 case "float32x4": |
| 2214 case "int32x4": |
2213 case "function": | 2215 case "function": |
2214 return x.toString(); | 2216 return x.toString(); |
2215 case "string": | 2217 case "string": |
2216 return "\"" + x.toString() + "\""; | 2218 return "\"" + x.toString() + "\""; |
2217 case "symbol": | 2219 case "symbol": |
2218 return "Symbol(" + (x.name ? Stringify(x.name, depth) : "") + ")" | 2220 return "Symbol(" + (x.name ? Stringify(x.name, depth) : "") + ")" |
2219 case "object": | 2221 case "object": |
2220 if (IS_NULL(x)) return "null"; | 2222 if (IS_NULL(x)) return "null"; |
2221 if (x.constructor && x.constructor.name === "Array") { | 2223 if (x.constructor && x.constructor.name === "Array") { |
2222 var elems = []; | 2224 var elems = []; |
(...skipping 21 matching lines...) Expand all Loading... |
2244 if ("set" in desc) { | 2246 if ("set" in desc) { |
2245 var setter = desc.set.toString(); | 2247 var setter = desc.set.toString(); |
2246 props.push("set " + name + setter.slice(setter.indexOf('('))); | 2248 props.push("set " + name + setter.slice(setter.indexOf('('))); |
2247 } | 2249 } |
2248 } | 2250 } |
2249 return "{" + props.join(", ") + "}"; | 2251 return "{" + props.join(", ") + "}"; |
2250 default: | 2252 default: |
2251 return "[crazy non-standard shit]"; | 2253 return "[crazy non-standard shit]"; |
2252 } | 2254 } |
2253 } | 2255 } |
OLD | NEW |