File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,16 @@ var $builtinmodule = function (name) {
469
469
return false ;
470
470
}
471
471
472
+ var Skinherits = function ( childCtor , parentCtor ) {
473
+ /** @constructor */
474
+ function tempCtor ( ) { } ;
475
+ tempCtor . prototype = parentCtor . prototype ;
476
+ childCtor . superClass_ = parentCtor . prototype ;
477
+ childCtor . prototype = new tempCtor ( ) ;
478
+ /** @override */
479
+ childCtor . prototype . constructor = childCtor ;
480
+ } ;
481
+
472
482
mod . namedtuple = function ( name , fields ) {
473
483
if ( Sk . ffi . remapToJs ( Sk . misceval . callsim ( keywds . $d [ 'iskeyword' ] , name ) ) ) {
474
484
throw new Sk . builtin . ValueError ( "Type names and field names cannot be a keyword: " + name . v ) ;
@@ -514,7 +524,7 @@ var $builtinmodule = function (name) {
514
524
} ;
515
525
mod . namedtuples [ nm ] = cons ;
516
526
517
- goog . inherits ( cons , Sk . builtin . tuple ) ;
527
+ Skinherits ( cons , Sk . builtin . tuple ) ;
518
528
cons . prototype . tp$name = nm ;
519
529
cons . prototype . ob$type = Sk . builtin . type . makeIntoTypeObj ( nm , mod . namedtuples [ nm ] ) ;
520
530
cons . prototype [ "$r" ] = function ( ) {
You can’t perform that action at this time.
0 commit comments