@lwc/engine-core 8.12.0 → 8.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -133
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +26 -158
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -1091,18 +1091,6 @@ function updateComponentValue(vm, key, newValue) {
|
|
|
1091
1091
|
const { isArray } = Array;
|
|
1092
1092
|
const { prototype: ObjectDotPrototype, getPrototypeOf, create: ObjectCreate, defineProperty: ObjectDefineProperty, isExtensible, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, preventExtensions, hasOwnProperty, } = Object;
|
|
1093
1093
|
const { push: ArrayPush, concat: ArrayConcat } = Array.prototype;
|
|
1094
|
-
const OtS = {}.toString;
|
|
1095
|
-
function toString(obj) {
|
|
1096
|
-
if (obj && obj.toString) {
|
|
1097
|
-
return obj.toString();
|
|
1098
|
-
}
|
|
1099
|
-
else if (typeof obj === 'object') {
|
|
1100
|
-
return OtS.call(obj);
|
|
1101
|
-
}
|
|
1102
|
-
else {
|
|
1103
|
-
return obj + '';
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
1094
|
function isUndefined(obj) {
|
|
1107
1095
|
return obj === undefined;
|
|
1108
1096
|
}
|
|
@@ -1340,10 +1328,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
|
|
|
1340
1328
|
return true;
|
|
1341
1329
|
}
|
|
1342
1330
|
setPrototypeOf(shadowTarget, prototype) {
|
|
1343
|
-
/* istanbul ignore else */
|
|
1344
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1345
|
-
throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
|
|
1346
|
-
}
|
|
1347
1331
|
}
|
|
1348
1332
|
preventExtensions(shadowTarget) {
|
|
1349
1333
|
if (isExtensible(shadowTarget)) {
|
|
@@ -1407,147 +1391,31 @@ class ReadOnlyHandler extends BaseProxyHandler {
|
|
|
1407
1391
|
if (!isUndefined(wrappedSetter)) {
|
|
1408
1392
|
return wrappedSetter;
|
|
1409
1393
|
}
|
|
1410
|
-
const handler = this;
|
|
1411
1394
|
const set = function (v) {
|
|
1412
|
-
/* istanbul ignore else */
|
|
1413
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1414
|
-
const { originalTarget } = handler;
|
|
1415
|
-
throw new Error(`Invalid mutation: Cannot invoke a setter on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
1416
|
-
}
|
|
1417
1395
|
};
|
|
1418
1396
|
setterMap.set(originalSet, set);
|
|
1419
1397
|
return set;
|
|
1420
1398
|
}
|
|
1421
1399
|
set(shadowTarget, key, value) {
|
|
1422
|
-
/* istanbul ignore else */
|
|
1423
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1424
|
-
const { originalTarget } = this;
|
|
1425
|
-
const msg = isArray(originalTarget)
|
|
1426
|
-
? `Invalid mutation: Cannot mutate array at index ${key.toString()}. Array is read-only.`
|
|
1427
|
-
: `Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`;
|
|
1428
|
-
throw new Error(msg);
|
|
1429
|
-
}
|
|
1430
1400
|
/* istanbul ignore next */
|
|
1431
1401
|
return false;
|
|
1432
1402
|
}
|
|
1433
1403
|
deleteProperty(shadowTarget, key) {
|
|
1434
|
-
/* istanbul ignore else */
|
|
1435
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1436
|
-
const { originalTarget } = this;
|
|
1437
|
-
throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
1438
|
-
}
|
|
1439
1404
|
/* istanbul ignore next */
|
|
1440
1405
|
return false;
|
|
1441
1406
|
}
|
|
1442
1407
|
setPrototypeOf(shadowTarget, prototype) {
|
|
1443
|
-
/* istanbul ignore else */
|
|
1444
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1445
|
-
const { originalTarget } = this;
|
|
1446
|
-
throw new Error(`Invalid prototype mutation: Cannot set prototype on "${originalTarget}". "${originalTarget}" prototype is read-only.`);
|
|
1447
|
-
}
|
|
1448
1408
|
}
|
|
1449
1409
|
preventExtensions(shadowTarget) {
|
|
1450
|
-
/* istanbul ignore else */
|
|
1451
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1452
|
-
const { originalTarget } = this;
|
|
1453
|
-
throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
|
|
1454
|
-
}
|
|
1455
1410
|
/* istanbul ignore next */
|
|
1456
1411
|
return false;
|
|
1457
1412
|
}
|
|
1458
1413
|
defineProperty(shadowTarget, key, descriptor) {
|
|
1459
|
-
/* istanbul ignore else */
|
|
1460
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1461
|
-
const { originalTarget } = this;
|
|
1462
|
-
throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
|
|
1463
|
-
}
|
|
1464
1414
|
/* istanbul ignore next */
|
|
1465
1415
|
return false;
|
|
1466
1416
|
}
|
|
1467
1417
|
}
|
|
1468
1418
|
|
|
1469
|
-
function extract(objectOrArray) {
|
|
1470
|
-
if (isArray(objectOrArray)) {
|
|
1471
|
-
return objectOrArray.map((item) => {
|
|
1472
|
-
const original = unwrap$1(item);
|
|
1473
|
-
if (original !== item) {
|
|
1474
|
-
return extract(original);
|
|
1475
|
-
}
|
|
1476
|
-
return item;
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
const obj = ObjectCreate(getPrototypeOf(objectOrArray));
|
|
1480
|
-
const names = getOwnPropertyNames(objectOrArray);
|
|
1481
|
-
return ArrayConcat.call(names, getOwnPropertySymbols(objectOrArray)).reduce((seed, key) => {
|
|
1482
|
-
const item = objectOrArray[key];
|
|
1483
|
-
const original = unwrap$1(item);
|
|
1484
|
-
if (original !== item) {
|
|
1485
|
-
seed[key] = extract(original);
|
|
1486
|
-
}
|
|
1487
|
-
else {
|
|
1488
|
-
seed[key] = item;
|
|
1489
|
-
}
|
|
1490
|
-
return seed;
|
|
1491
|
-
}, obj);
|
|
1492
|
-
}
|
|
1493
|
-
const formatter = {
|
|
1494
|
-
header: (plainOrProxy) => {
|
|
1495
|
-
const originalTarget = unwrap$1(plainOrProxy);
|
|
1496
|
-
// if originalTarget is falsy or not unwrappable, exit
|
|
1497
|
-
if (!originalTarget || originalTarget === plainOrProxy) {
|
|
1498
|
-
return null;
|
|
1499
|
-
}
|
|
1500
|
-
const obj = extract(plainOrProxy);
|
|
1501
|
-
return ['object', { object: obj }];
|
|
1502
|
-
},
|
|
1503
|
-
hasBody: () => {
|
|
1504
|
-
return false;
|
|
1505
|
-
},
|
|
1506
|
-
body: () => {
|
|
1507
|
-
return null;
|
|
1508
|
-
},
|
|
1509
|
-
};
|
|
1510
|
-
// Inspired from paulmillr/es6-shim
|
|
1511
|
-
// https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
|
|
1512
|
-
/* istanbul ignore next */
|
|
1513
|
-
function getGlobal() {
|
|
1514
|
-
// the only reliable means to get the global object is `Function('return this')()`
|
|
1515
|
-
// However, this causes CSP violations in Chrome apps.
|
|
1516
|
-
if (typeof globalThis !== 'undefined') {
|
|
1517
|
-
return globalThis;
|
|
1518
|
-
}
|
|
1519
|
-
if (typeof self !== 'undefined') {
|
|
1520
|
-
return self;
|
|
1521
|
-
}
|
|
1522
|
-
if (typeof window !== 'undefined') {
|
|
1523
|
-
return window;
|
|
1524
|
-
}
|
|
1525
|
-
if (typeof global !== 'undefined') {
|
|
1526
|
-
return global;
|
|
1527
|
-
}
|
|
1528
|
-
// Gracefully degrade if not able to locate the global object
|
|
1529
|
-
return {};
|
|
1530
|
-
}
|
|
1531
|
-
function init() {
|
|
1532
|
-
/* istanbul ignore if */
|
|
1533
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1534
|
-
// this method should never leak to prod
|
|
1535
|
-
throw new ReferenceError();
|
|
1536
|
-
}
|
|
1537
|
-
const global = getGlobal();
|
|
1538
|
-
// Custom Formatter for Dev Tools. To enable this, open Chrome Dev Tools
|
|
1539
|
-
// - Go to Settings,
|
|
1540
|
-
// - Under console, select "Enable custom formatters"
|
|
1541
|
-
// For more information, https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview
|
|
1542
|
-
const devtoolsFormatters = global.devtoolsFormatters || [];
|
|
1543
|
-
ArrayPush.call(devtoolsFormatters, formatter);
|
|
1544
|
-
global.devtoolsFormatters = devtoolsFormatters;
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
/* istanbul ignore else */
|
|
1548
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1549
|
-
init();
|
|
1550
|
-
}
|
|
1551
1419
|
function defaultValueIsObservable(value) {
|
|
1552
1420
|
// intentionally checking for null
|
|
1553
1421
|
if (value === null) {
|
|
@@ -8571,5 +8439,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
8571
8439
|
exports.track = track;
|
|
8572
8440
|
exports.unwrap = unwrap;
|
|
8573
8441
|
exports.wire = wire;
|
|
8574
|
-
/** version: 8.12.
|
|
8442
|
+
/** version: 8.12.1 */
|
|
8575
8443
|
//# sourceMappingURL=index.cjs.js.map
|