Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-101620 Deprecate Liferay.Util.randomInt #87824

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -33,7 +33,7 @@ AUI().use(

var Notification = Config.win.Notification;

var windowId = Liferay.Util.randomInt();
var windowId = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER);

var now = Date.now;

Expand Down
Expand Up @@ -872,7 +872,9 @@ AUI.add(
};

LiferayFieldSupport.prototype._randomString = function(length) {
var randomString = Liferay.Util.randomInt().toString(36);
var randomString = Math.ceil(
Math.random() * Number.MAX_SAFE_INTEGER
).toString(36);

return randomString.substring(0, length);
};
Expand Down
Expand Up @@ -17,7 +17,7 @@ AUI.add(
A => {
var AObject = A.Object;

var _browserKey = Liferay.Util.randomInt();
var _browserKey = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER);
var _enabled = false;
var _encryptedUserId = null;
var _supportsComet = false;
Expand Down
Expand Up @@ -918,6 +918,9 @@
document.all[id].focus();
},

/**
* @deprecated As of Athanasius (7.3.x), with no direct replacement
*/
randomInt() {
return Math.ceil(Math.random() * new Date().getTime());
},
Expand Down