@@ -25752,7 +25752,6 @@ var Component = module.exports.Component = function (el, attrValue, id) {
2575225752
2575325753 // Dynamic schema requires special handling of unknown properties to avoid false-positives.
2575425754 this.deferUnknownPropertyWarnings = !!this.updateSchema;
25755- this.silenceUnknownPropertyWarnings = false;
2575625755
2575725756 // Last value passed to updateProperties.
2575825757 // This type of throttle ensures that when a burst of changes occurs, the final change to the
@@ -25949,21 +25948,32 @@ Component.prototype = {
2594925948 this.updateSchemaIfNeeded(attrValue);
2595025949 },
2595125950 updateSchemaIfNeeded: function (attrValue) {
25952- if (!this.schemaChangeRequired || !this.updateSchema) {
25953- // Log any pending unknown property warning
25954- for (var i = 0; i < encounteredUnknownProperties.length; i++) {
25955- warn('Unknown property `' + encounteredUnknownProperties[i] + '` for component `' + this.name + '`.');
25956- }
25951+ if (this.schemaChangeRequired && this.updateSchema) {
2595725952 encounteredUnknownProperties.length = 0;
25958- return;
25953+ this.updateSchema(this.data);
25954+ utils.objectPool.removeUnusedKeys(this.data, this.schema);
25955+ this.recomputeData(attrValue);
25956+ this.schemaChangeRequired = false;
25957+
25958+ // Report any excess properties not valid in the updated schema
25959+ for (var key in this.attrValue) {
25960+ if (this.attrValue[key] === undefined) {
25961+ continue;
25962+ }
25963+ if (encounteredUnknownProperties.indexOf(key) !== -1) {
25964+ continue;
25965+ }
25966+ if (!(key in this.schema)) {
25967+ warn('Unknown property `' + key + '` for component `' + this.name + '`.');
25968+ }
25969+ }
25970+ }
25971+
25972+ // Log any pending unknown property warning
25973+ for (var i = 0; i < encounteredUnknownProperties.length; i++) {
25974+ warn('Unknown property `' + encounteredUnknownProperties[i] + '` for component `' + this.name + '`.');
2595925975 }
2596025976 encounteredUnknownProperties.length = 0;
25961- this.updateSchema(this.data);
25962- utils.objectPool.removeUnusedKeys(this.data, this.schema);
25963- this.silenceUnknownPropertyWarnings = true;
25964- this.recomputeData(attrValue);
25965- this.silenceUnknownPropertyWarnings = false;
25966- this.schemaChangeRequired = false;
2596725977 },
2596825978 /**
2596925979 * Check if component should fire update and fire update lifecycle handler.
@@ -26133,13 +26143,10 @@ Component.prototype = {
2613326143 // Handle warning the user about the unknown property.
2613426144 // Since a component might have a dynamic schema, the warning might be
2613526145 // silenced or deferred to avoid false-positives.
26136- if (!this.silenceUnknownPropertyWarnings) {
26137- // Not silenced, so either deferred or logged.
26138- if (this.deferUnknownPropertyWarnings) {
26139- encounteredUnknownProperties.push(key);
26140- } else if (!this.silenceUnknownPropertyWarnings) {
26141- warn('Unknown property `' + key + '` for component `' + this.name + '`.');
26142- }
26146+ if (this.deferUnknownPropertyWarnings) {
26147+ encounteredUnknownProperties.push(key);
26148+ } else if (!this.silenceUnknownPropertyWarnings) {
26149+ warn('Unknown property `' + key + '` for component `' + this.name + '`.');
2614326150 }
2614426151 },
2614526152 /**
@@ -26183,32 +26190,15 @@ Component.prototype = {
2618326190 this.recomputeProperty(undefined, attrValue);
2618426191 return;
2618526192 }
26186- if (attrValue && typeof attrValue === 'object') {
26187- for (key in this.schema) {
26188- this.attrValueProxy[key] = attrValue[key];
26189- }
26190- } else {
26191- for (key in this.schema) {
26192- this.attrValueProxy[key] = undefined;
26193- }
26193+ for (key in this.schema) {
26194+ this.attrValueProxy[key] = undefined;
2619426195 }
26195- if (typeof attrValue === 'string') {
26196+ if (attrValue && typeof attrValue === 'object') {
26197+ utils.extend(this.attrValueProxy, attrValue);
26198+ } else if (typeof attrValue === 'string') {
2619626199 // AttrValue is a style string, parse it into the attrValueProxy object
2619726200 styleParser.parse(attrValue, this.attrValueProxy);
2619826201 }
26199-
26200- // Report any unknown properties
26201- for (key in this.attrValue) {
26202- if (this.attrValue[key] === undefined) {
26203- continue;
26204- }
26205- if (encounteredUnknownProperties.indexOf(key) === -1) {
26206- continue;
26207- }
26208- if (!(key in this.schema)) {
26209- warn('Unknown property `' + key + '` for component `' + this.name + '`.');
26210- }
26211- }
2621226202 },
2621326203 /**
2621426204 * Attach events from component-defined events map.
@@ -30176,7 +30166,7 @@ __webpack_require__(/*! ./core/a-mixin */ "./src/core/a-mixin.js");
3017630166// Extras.
3017730167__webpack_require__(/*! ./extras/components/ */ "./src/extras/components/index.js");
3017830168__webpack_require__(/*! ./extras/primitives/ */ "./src/extras/primitives/index.js");
30179- console.log('A-Frame Version: 1.6.0 (Date 2024-05-28, Commit #4ecbc512 )');
30169+ console.log('A-Frame Version: 1.6.0 (Date 2024-05-28, Commit #48da89a4 )');
3018030170console.log('THREE Version (https://github.com/supermedium/three.js):', THREE.REVISION);
3018130171console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
3018230172
0 commit comments