Questions tagged [strict-mode]

According to Mozilla Developer Network, ECMAScript 5's strict mode is a way to opt in to a restricted variant of JavaScript. Strict mode isn't just a subset: it intentionally has different semantics from normal code.

According to Mozilla Developer Network, ECMAScript 5's strict mode is a way to opt in to a restricted variant of JavaScript. Strict mode isn't just a subset: it intentionally has different semantics from normal code.

112 questions
12
votes
1 answer

Strict mode alternatives to this instanceof arguments.callee

There's an old trick (that I learned on SO) to catch calling a constructor as a function, i.e. forgetting the new keyword. The following, or something like, it goes in each constructor at the top. if (!(this instanceof arguments.callee)) { throw…
user213154
11
votes
4 answers

How to disable strict mode while bundling React using webpack

Hello I am stuck with my application, my application working fine in all other browser not in IE it's throw the error 0x800a0416 - JavaScript runtime error: Multiple definitions of a property not allowed in strict mode I have implemented loader in…
Dhaval Patel
  • 7,471
  • 6
  • 37
  • 70
11
votes
1 answer

How to identify javascript undeletable properties?

In Javascript strict mode Deleting an undeletable property is not allowed To make sure that one do not delete such an undeletable property, how do one figure out property X is deletable and property Y is undeletable The concept behind it is......?
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219
8
votes
1 answer

babel-loader: Module build failed: SyntaxError: Deleting local variable in strict mode

I'm using babel-loader in webpack with a custom babel-plugin to transform some thirdparty code into a format that passes through Webpack's bundler without trouble. However, when my code runs through babel's parser (babylon) to build the AST, I get…
Kevin Koshiol
  • 162
  • 1
  • 9
7
votes
2 answers

How to get function name in strict mode [proper way]

arguments.callee unfortunatelly deprecated, and using it throws an error in "strict mode". Is there any new proper(standard) alternative for getting function name inside actual function? Or will it be in future plans ECMA6, 7? Recent answer is no…
Firanolfind
  • 1,559
  • 2
  • 17
  • 36
6
votes
4 answers

Should I disable MySQL strict mode?

I have been working on a site that had MySQL strict mode enabled. One person had a long user agent string that was logged in our log table and unfortunately the user agent string exceeded the limit for the column and thus caused a warning. The data…
Tower
  • 98,741
  • 129
  • 357
  • 507
6
votes
1 answer

Function.prototype.call alters typeof this, outside strict mode; why?

var example = function () { console.log(typeof this); return this; }; In strict mode: example.call('test') # prints 'string' Otherwise, example.call('test') # prints 'object' However, console.log(example.call('test')) prints test (as you'd…
hagemt
  • 328
  • 5
  • 12
5
votes
2 answers

react-draft-wysiwyg - Warning: Can't call setState

I did make a simple react app with react-draft-wysiwyg, but I get a warning. import React from "react"; import ReactDOM from "react-dom"; import { Editor } from "react-draft-wysiwyg"; import…
5
votes
2 answers

findDOMNode warnings with CSSTransition components

"react": "^16.13.1" "react-transition-group": "^4.3.0" Hi, everyone. I faced with findDOMNode warning and can't find the right solution on the…
5
votes
2 answers

Strict mode and reserved word

Why is this code fine: var test = { fn1: function(_origin, _componentType) { if(arguments.length > 1) throw "xx"; // this strict is ok "use strict"; var interface = new Object(this); } } While…
Buksy
  • 11,571
  • 9
  • 62
  • 69
5
votes
1 answer

Strict mode violations list

running adb logcat in the shell i see something like this StrictMode policy violation; ~duration=337 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=23 violation=2 what the policy=23 means ? what is violation=2 ? I was searching for…
Lukap
  • 31,523
  • 64
  • 157
  • 244
4
votes
1 answer

StrictMode prior 2.3

I was googleing the enableing StrictMode prior 2.3 but I couldn't find anything useful. All I found was that StrictMode is introduced in 2.3 and you can use reflection to check if there is strict mode like this try { Class sMode =…
Lukap
  • 31,523
  • 64
  • 157
  • 244
4
votes
1 answer

Warnings with using modals from reactstrap

I have some warnings: Warning: Legacy context API has been detected within a strict-mode tree. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. Please update the following components:…
4
votes
1 answer

WARNING: findDOMNode is deprecated in StrictMode, react-redux-notify

I am getting this warning while using, react-redux-notify index.js:1 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of CSSTransitionGroupChild which is inside StrictMode. Instead, add a ref directly to the…
raju
  • 6,448
  • 24
  • 80
  • 163
4
votes
3 answers

Vue.js - Dynamic inputs breaking in IE11

I'm getting an error when trying to create a dynamic input in Vue when attempting to view my app in IE. The page doesn't load and I get a "Multiple definitions of a property not allowed in strict mode." The input has both a v-model and :value…