Skip to content

Commit

Permalink
Change use of WHAT to ^name
Browse files Browse the repository at this point in the history
It's the recommended way. WHAT is used to actually get a type object, which isn't what we want. We want the name of the class the object was instantiated from.
  • Loading branch information
rafaelschipiura committed May 29, 2018
1 parent 264b941 commit eb9e59a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/Language/js-nutshell.pod6
Expand Up @@ -257,15 +257,15 @@ say $str; # def
=end code
While we are talking about C<instanceof>, the equivalent to C<typeof> or the
C<constructor> property on Node.js objects in Perl 6 is the C<WHAT> attribute:
C<constructor> property on Node.js objects in Perl 6 is the C<^name> meta-attribute:
=begin code :lang<javascript>
console.log(typeof 'foo'); // string
console.log('foo'.constructor); // String
=end code
=begin code :ok-test<WHAT>
say 'foo'.WHAT; # (Str)
=begin code
say 'foo'.^name; # Str
=end code
=head3 Numeric
Expand Down

0 comments on commit eb9e59a

Please sign in to comment.