question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Evaluate ES6 classes

See original GitHub issue

Why is this ‘idiom’ of inheritance being introduced into the code:

PointLight.prototype = Object.assign( Object.create( Light.prototype ), {

Seriously? Function(nested Function(ParentPrototype) COMMA SHOTGUN BRACKET?

The faithful two line style still in, for example, the Materials classes are much clearer and cleaner. Assign the prototype and then set the constructor. The end. Please don’t ruin the library by catching JavaScript disease - the bizarre need to masturbate the way objects and inheritance are coded. One style throughout the library. No need to change it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:13
  • Comments:93 (56 by maintainers)

github_iconTop GitHub Comments

35reactions
mrdoobcommented, Sep 6, 2017

Until browsers can execute natively TypeScript, I prefer to keep using JavaScript.

25reactions
sasha240100commented, Jun 19, 2017
class PointLight extends Light

hehe 😄 And no problems…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classes - JavaScript - MDN Web Docs
Classes are a template for creating objects. They encapsulate data with code to work on that data. Classes in JS are built on...
Read more >
How ES6 classes really work and how to build your own
How ES6 classes really work and how to build your own · Object model · Prototypal inheritance · Internal slots · Old style...
Read more >
15. Classes - Exploring JS
This section explains four approaches for managing private data for ES6 classes: Keeping private data in the environment of a class constructor; Marking...
Read more >
Classes in ECMAScript 6 (final semantics) - 2ality
Class definitions are the only way to create derived constructors (enabling ES6-style subclassing that works for built-in constructors). Class ...
Read more >
javascript - Using eval method to get class from string in Firefox
16 Runtime Semantics: Evaluation, under ClassDeclaration : class BindingIdentifier ClassTail which calls the section you referenced, and it shows Return ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found