Skip to content

Commit b0e2837

Browse files
committed
other/timeouts, part 2.2
1 parent ea30e5e commit b0e2837

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

doc/ru/other/timeouts.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,17 @@
7373

7474
### Скрытое использование `eval`
7575

76-
`setTimeout` and `setInterval` can also take a string as their first parameter.
77-
This feature should **never** be used, since it internally makes use of `eval`.
76+
`setTimeout` и `setInterval` могут принимать строку в качестве первого параметра. Эту возможность не следует использовать **никогда**, поскольку изнутри при этом производится скрытый вызов `eval`.
7877

79-
> **Note:** Since the timeout functions are **not** specified by the ECMAScript
80-
> standard, the exact workings when a string is passed to them might differ in
81-
> various JavaScript implementations. As a fact, Microsoft's JScript makes use of
82-
> the `Function` constructor in place of `eval`.
78+
> **Замечание**: Поскольку функции работы с таймаутами **не** определены в стандарте ECMAScript, точная внутренняя механика их работы может различаться от движка к движку. Известен факт, то Microsoft JScript использует конструктор `Function` вместо `eval`.
8379
8480
function foo() {
85-
// will get called
81+
// будет вызвана
8682
}
8783

8884
function bar() {
8985
function foo() {
90-
// never gets called
86+
// никогда не будет вызывана
9187
}
9288
setTimeout('foo()', 1000);
9389
}
@@ -102,10 +98,10 @@ function that will get called by either of the timeout functions.
10298

10399
function foo(a, b, c) {}
104100

105-
// NEVER use this
101+
// НИКОГДА не делайте такого
106102
setTimeout('foo(1,2, 3)', 1000)
107103

108-
// Instead use an anonymous function
104+
// Вместо этого используйте анонимную функцию
109105
setTimeout(function() {
110106
foo(a, b, c);
111107
}, 1000)

0 commit comments

Comments
 (0)