Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
jio
Commits
6502df5c
Commit
6502df5c
authored
Feb 28, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grammar nazi
parent
5fd24a93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/jio/core/util.js
src/jio/core/util.js
+8
-8
No files found.
src/jio/core/util.js
View file @
6502df5c
...
@@ -30,7 +30,7 @@ function inherits(constructor, superConstructor) {
...
@@ -30,7 +30,7 @@ function inherits(constructor, superConstructor) {
}
}
/**
/**
* Clones jsonable object in de
ep
* Clones jsonable object in de
pth
*
*
* @param {A} object The jsonable object to clone
* @param {A} object The jsonable object to clone
* @return {A} The cloned object
* @return {A} The cloned object
...
@@ -51,7 +51,7 @@ exports.util.jsonDeepClone = jsonDeepClone;
...
@@ -51,7 +51,7 @@ exports.util.jsonDeepClone = jsonDeepClone;
* It can also clone object which are serializable, like Date.
* It can also clone object which are serializable, like Date.
*
*
* To make a class serializable, you need to implement the `toJSON` function
* To make a class serializable, you need to implement the `toJSON` function
* which returns a JSON representation of the object. The return value is used
* which returns a JSON representation of the object. The return
ed
value is used
* as first parameter of the object constructor.
* as first parameter of the object constructor.
*
*
* @param {A} object The object to clone
* @param {A} object The object to clone
...
@@ -81,12 +81,12 @@ function deepClone(object) {
...
@@ -81,12 +81,12 @@ function deepClone(object) {
}
}
if
(
object
instanceof
Date
)
{
if
(
object
instanceof
Date
)
{
// XXX this block is to enable phantomjs and browsers compatibility with
// XXX this block is to enable phantomjs and browsers compatibility with
// Date.prototype.toJSON when it is a invalid date. In phantomjs, it
// Date.prototype.toJSON when it is a
n
invalid date. In phantomjs, it
// returns `"Invalid Date"` but in browsers it returns `null`. In
// returns `"Invalid Date"` but in browsers it returns `null`. In
// browsers, giv
e
`null` as parameter to `new Date()` doesn't return an
// browsers, giv
ing
`null` as parameter to `new Date()` doesn't return an
// invalid date.
// invalid date.
// Clon
ning date with `return new Date(object)` make
problems on Firefox.
// Clon
ing a date with `return new Date(object)` has
problems on Firefox.
// I don't know why... (Tested on Firefox 23)
// I don't know why... (Tested on Firefox 23)
if
(
isFinite
(
object
.
getTime
()))
{
if
(
isFinite
(
object
.
getTime
()))
{
...
@@ -106,7 +106,7 @@ function deepClone(object) {
...
@@ -106,7 +106,7 @@ function deepClone(object) {
exports
.
util
.
deepClone
=
deepClone
;
exports
.
util
.
deepClone
=
deepClone
;
/**
/**
* Update a diction
n
ary by adding/replacing key values from another dict.
* Update a dictionary by adding/replacing key values from another dict.
* Enumerable values equal to undefined are also used.
* Enumerable values equal to undefined are also used.
*
*
* @param {Object} original The dict to update
* @param {Object} original The dict to update
...
@@ -298,7 +298,7 @@ exports.util.readBlobAsText = readBlobAsText;
...
@@ -298,7 +298,7 @@ exports.util.readBlobAsText = readBlobAsText;
/**
/**
* Send request with XHR and return a promise. xhr.onload: The promise is
* Send request with XHR and return a promise. xhr.onload: The promise is
* resolve when the status code is lower than 400 with the xhr object as first
* resolve
d
when the status code is lower than 400 with the xhr object as first
* parameter. xhr.onerror: reject with xhr object as first
* parameter. xhr.onerror: reject with xhr object as first
* parameter. xhr.onprogress: notifies the xhr object.
* parameter. xhr.onprogress: notifies the xhr object.
*
*
...
@@ -307,7 +307,7 @@ exports.util.readBlobAsText = readBlobAsText;
...
@@ -307,7 +307,7 @@ exports.util.readBlobAsText = readBlobAsText;
* @param {String} [param.dataType=""] The data type to retrieve
* @param {String} [param.dataType=""] The data type to retrieve
* @param {String} param.url The url
* @param {String} param.url The url
* @param {Any} [param.data] The data to send
* @param {Any} [param.data] The data to send
* @param {Function} [param.beforeSend] A function called just before send
* @param {Function} [param.beforeSend] A function called just before
the
send
* request. The first parameter of this function is the XHR object.
* request. The first parameter of this function is the XHR object.
* @return {Promise} The promise
* @return {Promise} The promise
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment