Skip to content

Commit

Permalink
Fix issues from Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyaulee committed Sep 16, 2022
1 parent 5fa6505 commit fff66ed
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/JsBind.Net/content/dist/JsBindNet.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
* @param {any} key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsDelegateReference(value)) {
return DelegateReferenceHandler.getOrCreateDelegateProxy(value).proxyFunction;
}
Expand Down Expand Up @@ -667,7 +667,7 @@
* @param {any} key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsObjectBindingConfiguration(value)) {
if (value.id) {
this.foundObject(value);
Expand Down Expand Up @@ -734,7 +734,7 @@
* @param {any} key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsObjectReference(value)) {
return JsObjectHandler.getObjectFromAccessPath(value.accessPath);
}
Expand Down Expand Up @@ -972,4 +972,4 @@

globalThis.JsBindNet = new JsBindNet();

}());
})();
4 changes: 2 additions & 2 deletions src/JsBind.Net/content/src/Modules/Guid.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
return globalThis.crypto.randomUUID();
}

return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ globalThis.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
return (1e7.toString() + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(parseInt(c) ^ globalThis.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> parseInt(c) / 4).toString(16)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { IsDelegateReference } from "../References/DelegateReference.js";
class DelegateReferenceReviverClass {
/**
* Converts a DelegateReference JSON object to a proxy function.
* @param {any} key
* @param {any} _key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsDelegateReference(value)) {
return DelegateReferenceHandler.getOrCreateDelegateProxy(value).proxyFunction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class ObjectBindingConfigurationReviverClass {

/**
* Revives reference binding configuration.
* @param {any} key
* @param {any} _key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsObjectBindingConfiguration(value)) {
if (value.id) {
this.foundObject(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { IsObjectReference } from "../References/ObjectReference.js";
class ObjectReferenceReviverClass {
/**
* Converts an ObjectReference JSON object to an object.
* @param {any} key
* @param {any} _key
* @param {any} value
*/
revive(key, value) {
revive(_key, value) {
if (IsObjectReference(value)) {
return JsObjectHandler.getObjectFromAccessPath(value.accessPath);
}
Expand Down
2 changes: 1 addition & 1 deletion test/JsBind.Net.TestsRunner/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Runner
public async Task RunTests()
{
var currentDirectory = Directory.GetCurrentDirectory();
var solutionDirectory = currentDirectory.Substring(0, currentDirectory.IndexOf("\\test"));
var solutionDirectory = currentDirectory[..currentDirectory.IndexOf("\\test")];
var driverPath = "C:\\SeleniumWebDrivers\\ChromeDriver";
var resultsPath = $"{solutionDirectory}\\test\\TestResults";
#if DEBUG
Expand Down

0 comments on commit fff66ed

Please sign in to comment.