Esta página lista as funcionalidades de JavaScript que estão obsoletas (ou seja, ainda disponíveis, mas planeadas para remoção) e obsoletas (isto é, não são mais utilizáveis).
Funcionalidades obsoletas
Estas funcionalidades obsoletas ainda podem ser utilziadas, mas devem ser utilizadas com cuidado, pois espera-se que estas sejam removidas inteiramente no futuro. Deverá trabalhar para remover a utilização das mesmas do seu código..
Propriedades de RegExp
The following properties are deprecated. This does not affect their use in replacement strings:
Propriedades | Descrição |
---|---|
$1-$9 |
Parenthesized substring matches, if any. |
$_ |
See input . |
$* |
See multiline . |
$& |
See lastMatch . |
$+ |
See lastParen . |
$` |
See leftContext . |
$' |
See rightContext . |
input |
The string against which a regular expression is matched. |
lastMatch |
The last matched characters. |
lastParen |
The last parenthesized substring match, if any. |
leftContext |
The substring preceding the most recent match. |
rightContext |
The substring following the most recent match. |
The following are now properties of RegExp
instances, no longer of the RegExp
object:
Propriedades | Descrição |
---|---|
global |
Whether or not to test the regular expression against all possible matches in a string, or only against the first. |
ignoreCase |
Whether or not to ignore case while attempting a match in a string. |
lastIndex |
The index at which to start the next match. |
multiline |
Whether or not to search in strings across multiple lines. |
source |
The text of the pattern. |
Métodos de egExp
- The
compile()
method is deprecated. - The
valueOf
method is no longer specialized forRegExp
. UseObject.valueOf()
.
Propriedades de Function
Gerador de Legacy
Legacy generator function statement
andLegacy generator function expression
are deprecated. Usefunction* statement
andfunction* expression
instead.JS1.7/JS1.8 Array comprehension
andJS1.7/JS1.8 Generator comprehension
are deprecated.
Iterator
StopIteration
is deprecated.Iterator
is deprecated.
Métodos de Object
watch
andunwatch
are deprecated. UseProxy
instead.__iterator__
is deprecated.__noSuchMethod__
is deprecated. UseProxy
instead.
Métodos de Date
getYear
andsetYear
are affected by the Year-2000-Problem and have been subsumed bygetFullYear
andsetFullYear
.- You should use
toISOString
instead of the deprecatedtoGMTString
method in new code. toLocaleFormat
is deprecated.
Functions
- Expression closures are deprecated. Use regular
functions
or arrow functions instead.
Proxy
- Proxy.create and Proxy.createFunction are deprecated. Use
Proxy
instead. - The following traps are obsolete:
hasOwn
(bug 980565, Firefox 33).getEnumerablePropertyKeys
(bug 783829, Firefox 37)getOwnPropertyNames
(bug 1007334, Firefox 33)keys
(bug 1007334, Firefox 33)
Sequências de Escape
- Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.
- The
escape
andunescape
functions are deprecated. UseencodeURI
,encodeURIComponent
,decodeURI
ordecodeURIComponent
to encode and decode escape sequences for special characters.
Métodos de String
- HTML wrapper methods like
String.prototype.fontsize
andString.prototype.big
. String.prototype.quote
is removed from Firefox 37.- non standard
flags
parameter inString.prototype.search
,String.prototype.match
, andString.prototype.replace
are deprecated.
Funcionalidades removidas
Estas funcionalidades obsoletas foram totalmente removidas do JavaScript e não podem mais ser utilizadas a partir da versão indicada do JavaScript.
Object
Property | Description |
---|---|
__count__ |
Returns the number of enumerable properties directly on a user-defined object. |
__parent__ |
Points to an object's context. |
Object.prototype.eval() |
Evaluates a string of JavaScript code in the context of the specified object. |
Object.observe() |
Asynchronously observing the changes to an object. |
Object.unobserve() |
Remove observers. |
Object.getNotifier() |
Creates an object that allows to synthetically trigger a change. |
Function
Property | Description |
---|---|
arity |
Number of formal arguments. |
Array
Property | Description |
Array.observe() |
Asynchronously observing changes to Arrays. |
Array.unobserve() |
Remove observers. |
Number
ParallelArray
Statements
for each...in
is deprecated. Usefor...of
instead.- Destructuring
for...in
is deprecated. Usefor...of
instead. - let blocks and let expressions are obsolete.
E4X
See E4X for more information.
Variáveis Sharp
Consulte Sharp variables in JavaScript para mais informação.