Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't throw the error so early, might result in unnecessary errors.

  • Loading branch information...
commit 4eb3e9ad067c91260e71d967f6432408cee496aa 1 parent 09f0752
@ctavan ctavan authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 uuid.js
View
12 uuid.js
@@ -139,12 +139,6 @@
// cycle to simulate higher resolution clock
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
- // Per 4.2.1.2 If generator creates more than one uuid per 100-ns
- // interval, throw an error
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
// Time since last uuid creation (in msecs)
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
@@ -160,6 +154,12 @@
nsecs = 0;
}
+ // Per 4.2.1.2 If generator creates more than one uuid per 100-ns
+ // interval, throw an error
+ if (nsecs >= 10000) {
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+ }
+
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
Please sign in to comment.
Something went wrong with that request. Please try again.