mirror of https://github.com/vitalif/phantomjs
Adding "date" detection to `detectType`
Addresses [Issue #800](http://code.google.com/p/phantomjs/issues/detail?id=800)1.8
parent
4c5e96d17f
commit
7c7d1f961c
|
@ -303,6 +303,8 @@ window.detectType = function (value) {
|
|||
s = 'array';
|
||||
} else if (value instanceof RegExp) {
|
||||
s = 'regexp';
|
||||
} else if (value instanceof Date) {
|
||||
s = 'date';
|
||||
}
|
||||
} else {
|
||||
s = 'null';
|
||||
|
|
|
@ -282,6 +282,7 @@ function decorateNewPage(opts, page) {
|
|||
switch (argType) {
|
||||
case "object": //< for type "object"
|
||||
case "array": //< for type "array"
|
||||
case "date": //< for type "date"
|
||||
str += "JSON.parse(" + JSON.stringify(JSON.stringify(arg)) + "),"
|
||||
break;
|
||||
case "string": //< for type "string"
|
||||
|
|
Loading…
Reference in New Issue