Weak type confusion

The forum for designers and developers.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Weak type confusion

Postby SilverEagle » 29. Nov 08, 00:05


User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Weak type confusion

Postby Service-Team » 29. Nov 08, 01:15


SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Weak type confusion

Postby SilverEagle » 30. Nov 08, 00:59


User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Weak type confusion

Postby Service-Team » 30. Nov 08, 15:00

SilverEagle wrote:
> [...] But maybe I misunderstood and SJ uses a
> library implementing the standard to the letter?

This is what we did, Silverjuke is using (abbreviation for Simple ECMAScript Engine).

> However the standard talks about a
> 'ToNumber' operator, not Number. How's that,
> what's the precise relation between SJ and
> ECMA-262?

SEE - and Silverjuke therefore - follows the ECMA-262 standards as described in the following reference: http://www.ecma-international.org/publi ... ma-262.htm

In the standard, Number() is defined where ToNumber() is not. See the reference, chapter 15.7.1 and chapter 9:
> When Number is called as a function rather than as a constructor, it performs a type conversion [...]
> [ToNumber is] not a part of the language; they are defined here to aid the specification of the semantics of the language

Maybe this makes some things clearer ...

Best regards,
Your Silverjuke-Team

SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Weak type confusion

Postby SilverEagle » 30. Nov 08, 15:36

Hi Team,

What a doc, about just as ugly as the USB 2.0 standard (which is my personal favorite - not)...

I read all the type conversion stuff, just missed the single remark in the first lines of chapter nine mentioning all the operators described were not part of the language :-(. I guess that cause I often have to spell out these type of specs during my daytime job I just cannot force myself for this hobby to give them the same level of attention...

Number() it is. And a 1.01 version of my competition skin will be on its way, with lots of 'Number()'s :-)

Regards,
SilverEagle


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Developer Network”