ecmascript-6


use 'transform-runtime' or ‘babel-polyfill’,but can't compile some functions of array


I hava use 'transform-runtime' with webpack, and it does work.However, some codes can't work.
new Array(4).fill(6);
my config:
test: /\.js?$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: ['transform-runtime']
}
},
it does't work
Unfortunately this is a limitation of transform-runtime. If you look at the npm package README you'll see:
NOTE: Instance methods such as "foobar".includes("foo") will not work since that would require modification of existing builtins
transform-runtime has does not know that fill in this case is Array.prototype.fill because it does not have any logic to see that .fill in this case is being called on an array object.

Related Links

ES6 export default imports into default object
Access Modifiers (Private, Protected) in ES6
Best way to have a defined argument follow an argument with default value in ES6?
Default export in ES6. Why don't you need a semicolon?
es6 accessor for export class function
feathers-client primus not found
Do es6 modules negate the need for browserify/webpack?
Angular2: No Directive annotation found on MyComponent
Sequential Promises i es6 javascript not working
ES6 import - different output file (webpack, babel)
How to implement “import” syntax in ES6 in ES5
Parse Failure When Using File with ES6 Syntax as Webpack Entry Point
react-redux handling multiple requests
Are ES6 Array comprehensions no longer valid?
Destructuring to get the last element of an array in es6
es6katas.org Kata #6: arrow functions - binding

Categories

HOME
algorithm
google-cloud-platform
checkstyle
spark-streaming
string
apache-flink
formal-languages
datastore
sh
sitecore
solver
requirements
tail
onclick
interpolation
data-visualization
text-mining
favicon
magnetic-cards
dynamic-sql
firefox-addon
google-container-registry
postscript
aggregation
direct3d11
surveymonkey
android-sharedpreferences
ceylon
paperjs
user-defined-functions
aws-codecommit
volatile
dumpbin
quickfixj
laravel-eloquent
hard-drive
browser-extension
sharepoint-workflow
parse-tree
salesforce-communities
password-protection
demo
resolution
skylink
parser-generator
cnc
reportservice2010
jtree
branch-prediction
sandcastle
polyline
cronexpression
pytables
meteor-packages
stax
omxplayer
webjars
pacemaker
installshield-2010
simevents
appscale
shopping
jtwig
bizagi
project-organization
cda
redis-cluster
computer-architecture
wiredep
vigenere
microsoft-reporting
toolkit
sony-lifelog-api
ember-cli-rails
dulwich
liquid-layout
botan
omnifaces
fits
grouping-sets
showdialog
ssis-data-flow
universal-image-loader
mdichild
cuba
cancellation
dsym
high-resolution
scrypt
neos-server
merb
time.h
dolby-audio-api
insert-id
stacky
fb.ui
preload
bjyauthorize
dajaxice
objectquery
relative
luabind
flex-mobile
google-ajax-api
creole
massive
timthumb
cloudfiles
maven-1
isapi-extension
scrollbars
glui
contentpresenter

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile