Skip to content

Commit

Permalink
Fix hepers
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 5, 2024
1 parent fdfe774 commit 28bf89b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions crates/swc_ecma_transforms_base/src/helpers/_apply_decs_2311.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

var PROP_KIND;
export default function applyDecs2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
function _apply_decs_2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) {
var symbolMetadata = Symbol.metadata || Symbol.for("Symbol.metadata");
var defineProperty = Object.defineProperty;
var create = Object.create;
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function applyDecs2311(targetClass, classDecs, memberDecs, classD
if (isPrivate) {
if (isField || isAccessor) {
desc = {
get: setFunctionName(function () {
get: _set_function_name(function () {
return decVal(this);
}, name, "get"),
set: function (value) {
Expand All @@ -72,7 +72,7 @@ export default function applyDecs2311(targetClass, classDecs, memberDecs, classD
desc[key] = decVal;
}
if (!isField) {
setFunctionName(desc[key], name, isMethod ? "" : key);
_set_function_name(desc[key], name, isMethod ? "" : key);
}
} else if (!isField) {
desc = Object.getOwnPropertyDescriptor(Class, name);
Expand Down Expand Up @@ -197,8 +197,8 @@ export default function applyDecs2311(targetClass, classDecs, memberDecs, classD
var name = decInfo[2];
var isPrivate = !!decInfo[3];
var decoratorsHaveThis = kind & 16;
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : toPropertyKey(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) {
return checkInRHS(_) === targetClass;
applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : _to_property_key(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) {
return _check_in_rhs(_) === targetClass;
} : instanceBrand);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function _checkInRHS(value) {
function _check_in_rhs(value) {
if (Object(value) !== value) {
throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function setFunctionName(fn, name, prefix) {
function _set_function_name(fn, name, prefix) {
if (typeof name === "symbol") {
name = name.description;
name = name ? "[" + name + "]" : "";
Expand All @@ -11,5 +11,3 @@ export function setFunctionName(fn, name, prefix) {
} catch (_) { }
return fn;
}

export { setFunctionName as _ }
6 changes: 3 additions & 3 deletions packages/helpers/esm/_apply_decs_2311.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import checkInRHS from "./_check_in_rhs.js";
import setFunctionName from "./_set_function_name.js";
import toPropertyKey from "./_to_property_key.js";
import { _ as checkInRHS } from "./_check_in_rhs.js";
import { _ as setFunctionName } from "./_set_function_name.js";
import { _ as toPropertyKey } from "./_to_property_key.js";


var PROP_KIND;
Expand Down
4 changes: 3 additions & 1 deletion packages/helpers/esm/_set_function_name.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function setFunctionName(fn, name, prefix) {
export function _set_function_name(fn, name, prefix) {
if (typeof name === "symbol") {
name = name.description;
name = name ? "[" + name + "]" : "";
Expand All @@ -11,3 +11,5 @@ export default function setFunctionName(fn, name, prefix) {
} catch (_) { }
return fn;
}

export { _set_function_name as _ }

0 comments on commit 28bf89b

Please sign in to comment.