提交 97c3a825 编写于 作者: fxy060608's avatar fxy060608

chore: Object.prototype.hasOwnProperty.call => hasOwn

上级 0f19e6d9
...@@ -19530,7 +19530,7 @@ function initKeyboardEvent() { ...@@ -19530,7 +19530,7 @@ function initKeyboardEvent() {
function onNodeEvent(nodeId, evt, pageNode) { function onNodeEvent(nodeId, evt, pageNode) {
const type = evt.type; const type = evt.type;
if (type === 'onFocus' || type === 'onBlur') { if (type === 'onFocus' || type === 'onBlur') {
hookKeyboardEvent(evt, evt => { hookKeyboardEvent(evt, (evt) => {
pageNode.fireEvent(nodeId, evt); pageNode.fireEvent(nodeId, evt);
}); });
} }
......
import { ref, computed, ExtractPropTypes, Ref, onMounted } from 'vue' import { ref, computed, ExtractPropTypes, Ref, onMounted } from 'vue'
import { extend, isFunction } from '@vue/shared' import { extend, hasOwn, isFunction } from '@vue/shared'
import type { Actions, OperateCanvasType } from '@dcloudio/uni-api' import type { Actions, OperateCanvasType } from '@dcloudio/uni-api'
import { import {
useAttrs, useAttrs,
...@@ -37,8 +37,8 @@ function resolveColor(color: number[]) { ...@@ -37,8 +37,8 @@ function resolveColor(color: number[]) {
function processTouches(target: EventTarget, touches: TouchEvent['touches']) { function processTouches(target: EventTarget, touches: TouchEvent['touches']) {
const eventTarget = target as HTMLElement const eventTarget = target as HTMLElement
let boundingClientRect = eventTarget.getBoundingClientRect()
return Array.from(touches).map((touch) => { return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect()
return { return {
identifier: touch.identifier, identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left, x: touch.clientX - boundingClientRect.left,
...@@ -158,7 +158,7 @@ function useListeners( ...@@ -158,7 +158,7 @@ function useListeners(
(() => { (() => {
let obj = {} let obj = {}
for (const key in _$listeners) { for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) { if (hasOwn(_$listeners, key)) {
const event = (_$listeners as any)[key] const event = (_$listeners as any)[key]
;(obj as any)[key] = event ;(obj as any)[key] = event
} }
......
...@@ -129,7 +129,7 @@ function processClickEvent(node: Node, triggerItemClick: Function) { ...@@ -129,7 +129,7 @@ function processClickEvent(node: Node, triggerItemClick: Function) {
function normalizeAttrs(tagName: string, attrs: Data) { function normalizeAttrs(tagName: string, attrs: Data) {
if (!isPlainObject(attrs)) return if (!isPlainObject(attrs)) return
for (const key in attrs) { for (const key in attrs) {
if (Object.prototype.hasOwnProperty.call(attrs, key)) { if (hasOwn(attrs, key)) {
const value = attrs[key] const value = attrs[key]
if (tagName === 'img' && key === 'src') if (tagName === 'img' && key === 'src')
attrs[key] = getRealPath(value as string) attrs[key] = getRealPath(value as string)
......
...@@ -1646,8 +1646,8 @@ function resolveColor(color) { ...@@ -1646,8 +1646,8 @@ function resolveColor(color) {
} }
function processTouches(target, touches) { function processTouches(target, touches) {
const eventTarget = target; const eventTarget = target;
let boundingClientRect = eventTarget.getBoundingClientRect();
return Array.from(touches).map((touch) => { return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect();
return { return {
identifier: touch.identifier, identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left, x: touch.clientX - boundingClientRect.left,
...@@ -1743,7 +1743,7 @@ function useListeners(props2, Listeners, trigger) { ...@@ -1743,7 +1743,7 @@ function useListeners(props2, Listeners, trigger) {
let $listeners = shared.extend({}, (() => { let $listeners = shared.extend({}, (() => {
let obj = {}; let obj = {};
for (const key in _$listeners) { for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) { if (shared.hasOwn(_$listeners, key)) {
const event = _$listeners[key]; const event = _$listeners[key];
obj[key] = event; obj[key] = event;
} }
...@@ -5104,7 +5104,7 @@ function normalizeAttrs(tagName, attrs) { ...@@ -5104,7 +5104,7 @@ function normalizeAttrs(tagName, attrs) {
if (!shared.isPlainObject(attrs)) if (!shared.isPlainObject(attrs))
return; return;
for (const key in attrs) { for (const key in attrs) {
if (Object.prototype.hasOwnProperty.call(attrs, key)) { if (shared.hasOwn(attrs, key)) {
const value = attrs[key]; const value = attrs[key];
if (tagName === "img" && key === "src") if (tagName === "img" && key === "src")
attrs[key] = getRealPath(value); attrs[key] = getRealPath(value);
......
...@@ -6561,8 +6561,8 @@ function resolveColor(color) { ...@@ -6561,8 +6561,8 @@ function resolveColor(color) {
} }
function processTouches(target, touches) { function processTouches(target, touches) {
const eventTarget = target; const eventTarget = target;
let boundingClientRect = eventTarget.getBoundingClientRect();
return Array.from(touches).map((touch) => { return Array.from(touches).map((touch) => {
let boundingClientRect = eventTarget.getBoundingClientRect();
return { return {
identifier: touch.identifier, identifier: touch.identifier,
x: touch.clientX - boundingClientRect.left, x: touch.clientX - boundingClientRect.left,
...@@ -6661,7 +6661,7 @@ function useListeners(props2, Listeners, trigger) { ...@@ -6661,7 +6661,7 @@ function useListeners(props2, Listeners, trigger) {
let $listeners = extend({}, (() => { let $listeners = extend({}, (() => {
let obj = {}; let obj = {};
for (const key in _$listeners) { for (const key in _$listeners) {
if (Object.prototype.hasOwnProperty.call(_$listeners, key)) { if (hasOwn(_$listeners, key)) {
const event = _$listeners[key]; const event = _$listeners[key];
obj[key] = event; obj[key] = event;
} }
...@@ -11822,7 +11822,7 @@ function normalizeAttrs(tagName, attrs2) { ...@@ -11822,7 +11822,7 @@ function normalizeAttrs(tagName, attrs2) {
if (!isPlainObject(attrs2)) if (!isPlainObject(attrs2))
return; return;
for (const key in attrs2) { for (const key in attrs2) {
if (Object.prototype.hasOwnProperty.call(attrs2, key)) { if (hasOwn(attrs2, key)) {
const value = attrs2[key]; const value = attrs2[key];
if (tagName === "img" && key === "src") if (tagName === "img" && key === "src")
attrs2[key] = getRealPath(value); attrs2[key] = getRealPath(value);
...@@ -15335,7 +15335,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ ...@@ -15335,7 +15335,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({
const iframe = document.createElement("iframe"); const iframe = document.createElement("iframe");
watchEffect(() => { watchEffect(() => {
for (const key in $attrs.value) { for (const key in $attrs.value) {
if (Object.prototype.hasOwnProperty.call($attrs.value, key)) { if (hasOwn($attrs.value, key)) {
const attr2 = $attrs.value[key]; const attr2 = $attrs.value[key];
iframe[key] = attr2; iframe[key] = attr2;
} }
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
watchEffect, watchEffect,
onBeforeUnmount, onBeforeUnmount,
} from 'vue' } from 'vue'
import { hasOwn } from '@vue/shared'
import { import {
defineBuiltInComponent, defineBuiltInComponent,
ResizeSensor, ResizeSensor,
...@@ -50,7 +51,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({ ...@@ -50,7 +51,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
const iframe = document.createElement('iframe') const iframe = document.createElement('iframe')
watchEffect(() => { watchEffect(() => {
for (const key in $attrs.value) { for (const key in $attrs.value) {
if (Object.prototype.hasOwnProperty.call($attrs.value, key)) { if (hasOwn($attrs.value, key)) {
const attr = ($attrs.value as any)[key] const attr = ($attrs.value as any)[key]
;(iframe as any)[key] = attr ;(iframe as any)[key] = attr
} }
......
...@@ -797,8 +797,10 @@ importers: ...@@ -797,8 +797,10 @@ importers:
packages/uni-uts-vite: packages/uni-uts-vite:
specifiers: specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3050220220719003 '@dcloudio/uni-cli-shared': 3.0.0-alpha-3050220220719003
'@dcloudio/uts': 3.0.0-alpha-3050220220719003
dependencies: dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared '@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uts': link:../uts
packages/uni-vue: packages/uni-vue:
specifiers: specifiers:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册