diff --git a/internal/platform/canvas_model.go b/internal/platform/canvas_model.go index 392318f..b66152b 100644 --- a/internal/platform/canvas_model.go +++ b/internal/platform/canvas_model.go @@ -95,8 +95,8 @@ func modelJSONSafe(value any, depth int) bool { } return true case map[string]any: - for key, item := range value { - if canvasChoice(key, "__proto__", "constructor", "prototype") || !modelJSONSafe(item, depth+1) { + for _, item := range value { + if !modelJSONSafe(item, depth+1) { return false } } diff --git a/internal/platform/canvas_model_test.go b/internal/platform/canvas_model_test.go index 83e22c2..1b082cb 100644 --- a/internal/platform/canvas_model_test.go +++ b/internal/platform/canvas_model_test.go @@ -102,6 +102,8 @@ func TestCanonicalOperationsPreserveOpaquePayloadAndStableMoveIdentity(t *testin model.Versions[modelChildID] = 1 future := modelTestNode("future", modelRootID) future["componentId"], future["dataVersion"], future["data"], future["futureEnvelope"] = "plugin.future", float64(42), map[string]any{"nested": map[string]any{"list": []any{"x", float64(2)}}}, map[string]any{"retain": true} + future["data"].(map[string]any)["constructor"] = map[string]any{"retain": true} + future["data"].(map[string]any)["__proto__"] = map[string]any{"ordinary": "JSON data"} model.Elements["future"] = future op := modelOperation{ID: modelTestID(1), Changes: []modelChange{{Kind: "field", Target: modelTarget{ID: "a", Incarnation: 1}, Field: "ownerCanvasId", Before: modelJSON(modelRootID), After: modelJSON(modelChildID)}}} after, touched, err := applyModelOperations(model, []modelOperation{op})