From fb9a4a668cbb71a385d1916b5a7a69ff9e951c29 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Thu, 7 Feb 2019 16:41:24 -0800 Subject: [PATCH] fix(ivy): support web worker nodes in unknown property checks (#28610) We need to support rendering in contexts like web workers where nodes are emulated and properties may not be set directly. This commit gates property validation checks to environments that have real Node objects. FW-1043 #resolve PR Close #28610 --- modules/playground/e2e_test/web_workers/todo/BUILD.bazel | 1 - packages/core/src/render3/instructions.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/playground/e2e_test/web_workers/todo/BUILD.bazel b/modules/playground/e2e_test/web_workers/todo/BUILD.bazel index c2f93d37ae..907933a699 100644 --- a/modules/playground/e2e_test/web_workers/todo/BUILD.bazel +++ b/modules/playground/e2e_test/web_workers/todo/BUILD.bazel @@ -4,5 +4,4 @@ example_test( name = "todo", srcs = glob(["**/*.ts"]), server = "//modules/playground/src/web_workers/todo:devserver", - tags = ["fixme-ivy-aot"], ) diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index 2391924bb9..97dca5db87 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -1217,6 +1217,8 @@ function validateAgainstUnknownProperties( element: RElement | RComment, propName: string, tNode: TNode) { // If prop is not a known property of the HTML element... if (!(propName in element) && + // and we are in a browser context... (web worker nodes should be skipped) + typeof Node === 'function' && element instanceof Node && // and isn't a synthetic animation property... propName[0] !== ANIMATION_PROP_PREFIX) { // ... it is probably a user error and we should throw.