Skip to content
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [2.0.8](https://github-personal/rdkcentral/rdkNativeScript/compare/2.0.6...2.0.8)

- RDKEMW-22317 : Integrate VIPA widget 1.4.4.5 with nativescript [`#138`](https://github-personal/rdkcentral/rdkNativeScript/pull/138)
- RDKEMW-22637 : [VIPA][NativeScript][Rogers] FW request is getting tru… [`#137`](https://github-personal/rdkcentral/rdkNativeScript/pull/137)
- RDKEMW-22637 : [VIPA][NativeScript][Rogers] FW request is getting truncated in device logs [`fdff6e5`](https://github-personal/rdkcentral/rdkNativeScript/commit/fdff6e551d5502c97c8c6089a4a8958cddec5c0b)

#### [2.0.6](https://github-personal/rdkcentral/rdkNativeScript/compare/2.0.4...2.0.6)

- RDKEMW-18491 : [rdknativescript] add debugger support similar to webkit [`#134`](https://github-personal/rdkcentral/rdkNativeScript/pull/134)
Expand Down
19 changes: 18 additions & 1 deletion src/jsc/JavaScriptUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,24 @@ static JSValueRef consoleCallbackImpl(JSContextRef ctx, size_t argumentCount,

InspectorHTTPServer::singleton().sendConsoleMessage(ctx, level, oss.str().c_str());
#endif
NativeJSLogger::log(INFO, "%s", oss.str().c_str());
const std::string fullMsg = oss.str();
constexpr size_t kMaxLogChunk = 420;

if (fullMsg.size() <= kMaxLogChunk) {
NativeJSLogger::log(INFO, "%s", fullMsg.c_str());
} else {
size_t offset = 0;
while (offset < fullMsg.size()) {
const size_t len = std::min(kMaxLogChunk, fullMsg.size() - offset);
const bool hasMore = (offset + len) < fullMsg.size();
std::string chunk = fullMsg.substr(offset, len);
if (hasMore) {
chunk += " \u21b5"; // ↵ continuation marker
}
NativeJSLogger::log(INFO, "%s", chunk.c_str());
offset += len;
}
}
return JSValueMakeUndefined(ctx);
}

Expand Down
92 changes: 86 additions & 6 deletions src/jsc/modules/lib/URLSearchParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@

exports.implementation = class URLSearchParamsImpl {
constructor(globalObject, constructorArgs = [""], options = {}) {
const { doNotStripQMark = false } = options || {};
let init = constructorArgs[0];
let doNotStripQMark = false;
let init = "";

if (arguments.length === 1) {
init = globalObject;
} else {
const resolvedOptions = options || {};
doNotStripQMark = !!resolvedOptions.doNotStripQMark;
if (Array.isArray(constructorArgs)) {
init = constructorArgs[0];
} else {

Check failure on line 16 in src/jsc/modules/lib/URLSearchParams.js

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID Detected License Issue

Snippet with 'MIT' component license found (128 lines) Location: https://github.com/jsdom/whatwg-url/blob/v12.0.0/lib/URLSearchParams-impl.js#L7 Component license file: https://github.com/jsdom/whatwg-url/blob/v12.0.0/LICENSE.txt Component: pkg:github/jsdom/whatwg-url@v12.0.0 Download: https://github.com/jsdom/whatwg-url/archive/refs/tags/v12.0.0.tar.gz
init = constructorArgs;
}
}

this._list = [];
this._url = null;

Expand All @@ -20,10 +33,26 @@
}
this._list.push([pair[0], pair[1]]);
}
} else if (typeof init === "object" && Object.getPrototypeOf(init) === null) {
for (const name of Object.keys(init)) {
const value = init[name];
this._list.push([name, value]);
} else if (typeof init === "object" && init !== null && !Array.isArray(init)) {
// Handle URLSearchParams-like objects that expose an internal _list.
if (Array.isArray(init._list)) {
for (const pair of init._list) {
if (Array.isArray(pair) && pair.length >= 2) {
this._list.push([pair[0], pair[1]]);
}
}
} else if (typeof init.entries === "function") {
// Handle iterable URLSearchParams-compatible objects.
for (const pair of init.entries()) {
if (Array.isArray(pair) && pair.length >= 2) {
this._list.push([pair[0], pair[1]]);
}
}
} else {
for (const name of Object.keys(init)) {
const value = init[name];
this._list.push([name, value]);
}
}
} else {
this._list = urlencoded.parseUrlencodedString(init);
Expand All @@ -42,6 +71,7 @@
if (serializedQuery === null) {
this._url._potentiallyStripTrailingSpacesFromAnOpaquePath();
}

}
}

Expand Down Expand Up @@ -126,6 +156,56 @@
this._updateSteps();
}

forEach(callback, thisArg) {
if (typeof callback !== "function") {
throw new TypeError("Failed to execute 'forEach' on 'URLSearchParams': parameter 1 is not a function.");
}

for (const tuple of this._list) {
callback.call(thisArg, tuple[1], tuple[0], this);
}
}

entries() {
return this._list[Symbol.iterator]();
}

keys() {
const list = this._list;
let index = 0;
return {
next() {
if (index >= list.length) {
return { value: undefined, done: true };
}
const value = list[index][0];
index++;
return { value: value, done: false };
},
[Symbol.iterator]() {
return this;
}
};
}

values() {
const list = this._list;
let index = 0;
return {
next() {
if (index >= list.length) {
return { value: undefined, done: true };
}
const value = list[index][1];
index++;
return { value: value, done: false };
},
[Symbol.iterator]() {
return this;
}
};
}

[Symbol.iterator]() {
return this._list[Symbol.iterator]();
}
Expand Down
Loading
Loading