vitebonus / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Demo for EventTarget does not work : Assertion failed #639

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Go to EventTarget demo page : 
http://closure-library.googlecode.com/git/closure/goog/demos/eventtarget.html
=> Nothing is displayed.

What is the expected output? What do you see instead?
There is no output at all.

What version of the product are you using? On what operating system?
The one of deployed at 
http://closure-library.googlecode.com/git/closure/goog/demos/eventtarget.html
- on Chromium 33.0.1750.152 Ubuntu 12.04 

Please provide any additional information below.
In javascript console, the following error is thrown :
Assertion failed: Event target is not initialized. Did you call the superclass 
(goog.events.EventTarget) constructor?
The issue comes from a goog.base not called in Something class.

Note: we cannot accept patches without the contributor license agreement
being signed. See http://code.google.com/p/closure-
library/wiki/Contributors for more info.

Original issue reported on code.google.com by jcor...@idmog.com on 14 Apr 2014 at 4:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Here is a small patch to solve the issue (just added the goog.base).

diff --git a/closure/goog/demos/eventtarget.html 
b/closure/goog/demos/eventtarget.html
index b26250e..ce7c7c7 100644
--- a/closure/goog/demos/eventtarget.html
+++ b/closure/goog/demos/eventtarget.html
@@ -31,7 +31,9 @@ See the COPYING file for details.
   }

-  function Something() { }
+  function Something() {
+    goog.base(this);
+  }
   goog.inherits(Something, goog.events.EventTarget);

   Something.prototype.DoSomething = function() {

Original comment by jcor...@idmog.com on 14 Apr 2014 at 4:51

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed: see https://github.com/google/closure-library/issues/1

Original comment by joelt...@google.com on 20 Jul 2015 at 10:11