Error message

  • Deprecated function: Return type of DatabaseStatementBase::execute($args = [], $options = []) should either be compatible with PDOStatement::execute(?array $params = null): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2244 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).
  • Deprecated function: Return type of DatabaseStatementEmpty::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2346 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).
  • Deprecated function: Return type of DatabaseStatementEmpty::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2346 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).
  • Deprecated function: Return type of DatabaseStatementEmpty::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2346 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).
  • Deprecated function: Return type of DatabaseStatementEmpty::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2346 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).
  • Deprecated function: Return type of DatabaseStatementEmpty::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in require_once() (line 2346 of /home/xenoveritas/xenoveritas.org/includes/database/database.inc).

Why I hate the Eclipse WTP JavaScript validator

So I've got the following code:

var e = document.createElement("div");
e.appendChild(document.createTextNode("Some text"));

This generates a warning and one error, which are underlined above with a yellow and red line, respectively.

They are:

  1. Warning: Type mismatch: cannot convert from Element to ___e1
  2. Error: The function appendChild(Text) is undefined for the type ___e1

And a description of why this is stupid:

  1. JavaScript is untyped. By definition, it does not have type conversion errors. Which I guess is why it's a warning. But since the validator has apparently decided to pretend JavaScript is, in fact, typed, the type should be "Element" because that's the type it's initialized to!
  2. And this error is caused by the first warning - the function exists on Elements, but not the type is invented from nowhere.

Little things like this cause just about any JavaScript file to be riddled with warnings and errors, making the validator completely freaking useless.

Topics: 

Comments

Funny thing is you can type this: Element e = document.createElement("div"); (instead of var e = ...) and this make the validator happy. But of course it doesn't work in browsers. Grrr...

You'd be amazed at how much comment spam the comment rules block.

Really, it's ridiculous. It does make posting comments somewhat more annoying, but it blocks pretty much all comment spam.