From 2dd9864ea2ce80f3073888456c4a0a7a041c63f2 Mon Sep 17 00:00:00 2001 From: sulyi Date: Fri, 27 Jan 2017 22:51:56 +0100 Subject: [PATCH] [jsbuilt-ins] minor props fix --- youtube_dl/jsinterp/jsbuilt_ins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/jsinterp/jsbuilt_ins.py b/youtube_dl/jsinterp/jsbuilt_ins.py index 626ed2ac9..8fc48ec2c 100644 --- a/youtube_dl/jsinterp/jsbuilt_ins.py +++ b/youtube_dl/jsinterp/jsbuilt_ins.py @@ -66,9 +66,9 @@ def to_object(o): class JSBase(object): def __init__(self, name, own): - self.props = self.__class__.props.copy() self.name = name self.own = own + self.props = {} def __str__(self): return '[native code]' @@ -79,6 +79,7 @@ class JSBase(object): class JSProtoBase(JSBase): def __init__(self): + super(JSProtoBase, self).__init__('', self.props) cls = self.__class__ while cls is not JSProtoBase: cls = cls.__base__ @@ -86,7 +87,6 @@ class JSProtoBase(JSBase): props.update(self.props) self.props = props self.value = {} - super(JSProtoBase, self).__init__('', self.props) def __str__(self): return '' @@ -248,7 +248,7 @@ class JSFunctionPrototype(JSObjectPrototype): self.body = '' else: if isinstance(body, JSBase): - super(JSFunctionPrototype, self).__init__(body.props) + super(JSFunctionPrototype, self).__init__(body.own) self.body = '[native code]' elif isinstance(body, _native_function): super(JSFunctionPrototype, self).__init__()