WeChat gadget JavaScript support situation
May 17, 2021
WeChat Mini Program Development Document
Table of contents
JavaScript support
Run limits
For security reasons, dynamic execution of JS code is not supported in small programs, i.e.:
-
The use of eval to execute JS code is not supported
-
Creating functions with new Function is not supported
Client ES6 API support
WeChat Systrup already supports the vast majority of ES6 APIs, as follows (some APIs depend on system versions):
String
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
codePointAt
|
|
|
|
|
normalize
|
✘
|
✘
|
|
|
includes
|
|
|
|
|
startsWith
|
|
|
|
|
endsWith
|
|
|
|
|
repeat
|
|
|
|
|
String.fromCodePoint
|
|
|
|
|
Array
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
copyWithin
|
|
|
|
|
find
|
|
|
|
|
findIndex
|
|
|
|
|
fill
|
|
|
|
|
entries
|
|
|
|
|
keys
|
|
|
|
|
values
|
✘
|
|
|
✘
|
includes
|
✘
|
|
|
|
Array.from
|
|
|
|
|
Array.of
|
|
|
|
|
Number
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
isFinite
|
|
|
|
|
isNaN
|
|
|
|
|
parseInt
|
|
|
|
|
parseFloat
|
|
|
|
|
isInteger
|
|
|
|
|
EPSILON
|
|
|
|
|
isSafeInteger
|
|
|
|
|
Math
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
trunc
|
|
|
|
|
sign
|
|
|
|
|
cbrt
|
|
|
|
|
clz32
|
|
|
|
|
imul
|
|
|
|
|
fround
|
|
|
|
|
hypot
|
|
|
|
|
expm1
|
|
|
|
|
log1p
|
|
|
|
|
log10
|
|
|
|
|
log2
|
|
|
|
|
sinh
|
|
|
|
|
cosh
|
|
|
|
|
tanh
|
|
|
|
|
asinh
|
|
|
|
|
acosh
|
|
|
|
|
atanh
|
|
|
|
|
Object
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
is
|
|
|
|
|
assign
|
|
|
|
|
getOwnPropertyDescriptor
|
|
|
|
|
keys
|
|
|
|
|
getOwnPropertyNames
|
|
|
|
|
getOwnPropertySymbols
|
|
|
|
|
Other
|
iOS8
|
iOS9
|
iOS10+
|
Android
|
Symbol
|
|
|
|
|
Set
|
|
|
|
|
Map
|
|
|
|
|
Proxy
|
✘
|
✘
|
|
✘
|
Reflect
|
|
|
|
|
Promise
|
|
|
|