Mode used in languages such as Javascript and Perl to be able to code with a restricted version of those languages.
Questions tagged [strict]
490 questions
12
votes
1 answer
HTML5 Doctype with strict
I want a strict but fully compatible html5 alternative to:
Basically I want to ensure the use of closing tags just to keep everything well readable, consistent and highlighted clearly in editors.
The answer to this question is to…

Anon343224user
- 584
- 1
- 5
- 17
12
votes
4 answers
Non-strict, Immutable, Non-memoized Infinite series in Scala
I want an infinite non-strict series x1, x2, x3... that I can work with one element at a time, not memoizing the results in order to keep my memory usage constant. For the sake of specificity let's say it's a series of integers (e.g. the natural…

W.P. McNeill
- 16,336
- 12
- 75
- 111
11
votes
4 answers
Disable "use the function form of use strict" but keep the "Missing 'use strict' statement" warning
I am using jslint to validate my code.
I have "use strict" on all my pages.
How can I disable the message "use the function form of 'use strict'" but keep the "Missing 'use strict' statement" warning, so I won't forget to put it on new files?
Thanks

Randall Flagg
- 4,834
- 9
- 33
- 45
11
votes
1 answer
JavaScript: Strict mode and anonymous functions
Nearly all my JS files are wrapped in anonymous functions. If I include "use strict"; outside the anonymous function, is strict mode still applied to the anonymous function?
For example, is strict mode applied to the inner body of the anonymous…

FoobarisMaximus
- 1,109
- 3
- 13
- 18
11
votes
3 answers
Disable strict mode on MariaDB
When i run this sql in phpmyadmin
SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE;
it shows
@@SQL_MODE STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@@GLOBAL.SQL_MODE…

Dr.Mezo
- 807
- 3
- 10
- 25
11
votes
3 answers
Is there a good *strict* date parser for Java?
Is there a good, strict date parser for Java? I have access to Joda-Time but I have yet to see this option. I found the "Is there a good date parser for Java" question, and while this is related it is sort of the opposite. Whereas that question…

MetroidFan2002
- 29,217
- 16
- 62
- 80
11
votes
1 answer
NodeJS Strict Mode
Are there any advantages to using "use strict" in NodeJS? For example, a global object is not a good idea to use, as all your requests will mutate said object (assuming the object in question should be unique to each user, of course). In this case,…

Sterling Archer
- 22,070
- 18
- 81
- 118
11
votes
1 answer
C++ alignment - strict and weak
I'm reading N3485 C++ Standard Draft and in the section on alignment, it states the following:
3.11 Alignment [basic.align]
1 ...
An alignment is an implementation-defined integer value representing
the number of bytes between successive…

Tony The Lion
- 61,704
- 67
- 242
- 415
11
votes
3 answers
Strict Standards: mysqli_next_result() error with mysqli_multi_query
I have tried using multi_query but I keep getting a strict Standards message popping up.
$querystring = "INSERT INTO responses VALUES('1', '2', '3', '4'); INSERT INTO responses VALUES('1', '2', '3', '4')";
if (mysqli_multi_query($db,…

Phil
- 309
- 1
- 3
- 9
11
votes
2 answers
Replicating arguments.callee in strict mode
I'm working in strict mode for the first time and, what-d'ya-know, it's also the first time in ages being able to use a non strict mode property would be useful. My question here outlines the exact problem I'm having, but the solution I've worked…

wheresrhys
- 22,558
- 19
- 94
- 162
10
votes
2 answers
Under @flow strict, what alternatives are there to Object for utility functions?
I am interested in switching my Flow code to strict type checking, but I have some low-level utility functions that deal with Objects generically, such as:
// @flow strict
const hasKey = (o: Object): (string => boolean) =>
…

Nicholas Shanks
- 10,623
- 4
- 56
- 80
10
votes
2 answers
How to enable ECMAScript "use strict" globally?
I have a project with literally hundreds of JavaScript source files. I am wondering what is the best way to enable the strict mode for the project? I understand the consequences of this action and I am only looking for advice regarding the…

Tower
- 98,741
- 129
- 357
- 507
10
votes
5 answers
Strict ISO C Conformance Test
I am currently working on a C project that needs to be fairly portable among different building environments. The project targets POSIX-compliant systems on a hosted C environment.
One way to achieve a good degree of portability is to code under…

alecov
- 4,882
- 2
- 29
- 55
10
votes
1 answer
Node.js and eslint disagree on "use strict"
ESLint tells me that I do not need "use strict" at the top of my index.js file (it's a simple server like the 6-line one on https://nodejs.org/en/about/). Apparently all node modules are already in strict mode. Makes sense.
However, running node…

ivanjonas
- 599
- 7
- 19
10
votes
1 answer
Does strict mode prohibit statement level function declarations?
"use strict";
if (true) {
function foo() {
}
}
In PhpStorm this code shows an error:
Function statement not at top level of a program or function is prohibited
However, Chrome happily executes it, even in the debugger and without any console…

AndreKR
- 32,613
- 18
- 106
- 168