prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
31 lines (24 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (realm) {
// ECMA262 18.2.6.3
let name = "decodeURIComponent";
return new _index.NativeFunctionValue(realm, name, name, 1, (context, [encodedURIComponent], argCount, NewTarget) => {
if (NewTarget) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, `${name} is not a constructor`);
encodedURIComponent = encodedURIComponent.throwIfNotConcrete();
// 1. Let componentString be ? ToString(uri).
let componentString = _singletons.To.ToString(realm, encodedURIComponent);
// 2. Let reservedURIComponentSet be the empty String.
// 3. Return ? Encode(componentString, unescapedURIComponentSet).
try {
return new _index.StringValue(realm, decodeURIComponent(componentString));
} catch (e) {
throw realm.createErrorThrowCompletion(realm.intrinsics.URIError, e.message);
}
});
};
var _index = require("../../values/index.js");
var _singletons = require("../../singletons.js");
//# sourceMappingURL=decodeURIComponent.js.map