Skip to content

Commit f0c4ac3

Browse files
committed
add in the fix from vuejs#7878 to prevent the charAt error
1 parent f8c4054 commit f0c4ac3

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

dist/vue.common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ if (process.env.NODE_ENV !== 'production') {
19291929
var hasHandler = {
19301930
has: function has (target, key) {
19311931
var has = key in target;
1932-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1932+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19331933
if (!has && !isAllowed) {
19341934
warnNonPresent(target, key);
19351935
}

dist/vue.esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ if (process.env.NODE_ENV !== 'production') {
19271927
var hasHandler = {
19281928
has: function has (target, key) {
19291929
var has = key in target;
1930-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1930+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19311931
if (!has && !isAllowed) {
19321932
warnNonPresent(target, key);
19331933
}

dist/vue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ var initProxy;
19291929
var hasHandler = {
19301930
has: function has (target, key) {
19311931
var has = key in target;
1932-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1932+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19331933
if (!has && !isAllowed) {
19341934
warnNonPresent(target, key);
19351935
}

dist/vue.runtime.common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ if (process.env.NODE_ENV !== 'production') {
19021902
var hasHandler = {
19031903
has: function has (target, key) {
19041904
var has = key in target;
1905-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1905+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19061906
if (!has && !isAllowed) {
19071907
warnNonPresent(target, key);
19081908
}

dist/vue.runtime.esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1900,7 +1900,7 @@ if (process.env.NODE_ENV !== 'production') {
19001900
var hasHandler = {
19011901
has: function has (target, key) {
19021902
var has = key in target;
1903-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1903+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19041904
if (!has && !isAllowed) {
19051905
warnNonPresent(target, key);
19061906
}

dist/vue.runtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ var initProxy;
19021902
var hasHandler = {
19031903
has: function has (target, key) {
19041904
var has = key in target;
1905-
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1905+
var isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_');
19061906
if (!has && !isAllowed) {
19071907
warnNonPresent(target, key);
19081908
}

src/core/instance/proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if (process.env.NODE_ENV !== 'production') {
4545
const hasHandler = {
4646
has (target, key) {
4747
const has = key in target
48-
const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'
48+
const isAllowed = allowedGlobals(key) || (typeof key === 'string' && key.charAt(0) === '_')
4949
if (!has && !isAllowed) {
5050
warnNonPresent(target, key)
5151
}

0 commit comments

Comments
 (0)