diff --git a/packages/lwc-engine/src/framework/modules/uid.ts b/packages/lwc-engine/src/framework/modules/uid.ts index ba7c45bf60..33f9873e6d 100644 --- a/packages/lwc-engine/src/framework/modules/uid.ts +++ b/packages/lwc-engine/src/framework/modules/uid.ts @@ -1,4 +1,6 @@ import { OwnerKey } from "../vm"; +import { defineProperty } from './../language'; + function updateUID(oldVnode: VNode, vnode: VNode) { const { uid: oldUid } = oldVnode; diff --git a/packages/lwc-engine/src/framework/utils.ts b/packages/lwc-engine/src/framework/utils.ts index e36b82eb96..516c2ba57d 100644 --- a/packages/lwc-engine/src/framework/utils.ts +++ b/packages/lwc-engine/src/framework/utils.ts @@ -71,7 +71,7 @@ export function getAttrNameFromPropName(propName: string): string { // otherwise we do the regular canonical transformation. return propName.replace(CAPS_REGEX, (match: string): string => '-' + match.toLowerCase()); } - +export const usesNativeSymbols = typeof Symbol() === 'symbol'; export function noop() {} const classNameToClassMap = create(null); diff --git a/packages/lwc-engine/src/framework/vm.ts b/packages/lwc-engine/src/framework/vm.ts index 627ac262b1..c658742390 100644 --- a/packages/lwc-engine/src/framework/vm.ts +++ b/packages/lwc-engine/src/framework/vm.ts @@ -3,14 +3,14 @@ import { getComponentDef } from "./def"; import { createComponent, linkComponent, renderComponent } from "./component"; import { patch } from "./patch"; import { ArrayPush, isUndefined, isNull, keys, defineProperties, ArrayUnshift, ArraySlice } from "./language"; -import { addCallbackToNextTick, noop, EmptyObject } from "./utils"; +import { addCallbackToNextTick, noop, EmptyObject, usesNativeSymbols } from "./utils"; import { ViewModelReflection } from "./def"; import { invokeServiceHook, Services } from "./services"; import { invokeComponentMethod } from "./invoker"; let idx: number = 0; let uid: number = 0; -export const OwnerKey = Symbol('key'); +export const OwnerKey = usesNativeSymbols ? Symbol('key') : '$$OwnerKey$$'; export function addInsertionIndex(vm: VM) { if (process.env.NODE_ENV !== 'production') { diff --git a/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.html b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.html new file mode 100644 index 0000000000..191bb3aa22 --- /dev/null +++ b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.js b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.js new file mode 100644 index 0000000000..04ba50386c --- /dev/null +++ b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.js @@ -0,0 +1,5 @@ +import { Element } from 'engine'; + +export default class TestFormTag extends Element { + +} \ No newline at end of file diff --git a/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.spec.js b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.spec.js new file mode 100644 index 0000000000..17127e96aa --- /dev/null +++ b/packages/lwc-integration/src/components/rendering/test-form-tag/form-tag.spec.js @@ -0,0 +1,15 @@ +const assert = require('assert'); +describe('Object keys', () => { + const URL = 'http://localhost:4567/form-tag'; + let element; + + before(() => { + browser.url(URL); + }); + + it('should have the right value', function () { + const element = browser.element('.form-text'); + assert.ok(element); + assert.deepEqual(element.getText(), 'Form did render'); + }); +});