Skip to content

Commit 56ba0c0

Browse files
committed
Version bump v2.0.0-beta.19
+ Prevent errors in OOP to take 100% CPU + ECMASCript: Fix default export of variable
1 parent 8749dd8 commit 56ba0c0

File tree

5 files changed

+56
-6
lines changed

5 files changed

+56
-6
lines changed

codeintel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.0-beta.18'
1+
__version__ = '2.0.0-beta.19'

codeintel/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ def run(self):
836836
self.log.debug("CodeIntelManager thread started...")
837837

838838
while True:
839+
ok = False
840+
839841
self.init_child()
840842
if not self.proc:
841843
break # init child failed
@@ -850,6 +852,7 @@ def run(self):
850852
if not ch:
851853
# nothing read, EOF
852854
raise IOError("Failed to read from socket")
855+
ok = True
853856
if ch == b'{':
854857
length = int(buf)
855858
buf = ch
@@ -896,7 +899,7 @@ def run(self):
896899
self.state = CodeIntelManager.STATE_WAITING
897900
self.close()
898901

899-
if self.proc is True:
902+
if not ok:
900903
time.sleep(3)
901904

902905
self.log.debug("CodeIntelManager thread ended!")

codeintel/codeintel2/ecmacile.py

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
11
#!/usr/bin/env python
2-
# Copyright (c) 2004-2006 ActiveState Software Inc.
2+
# ***** BEGIN LICENSE BLOCK *****
3+
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
34
#
4-
# Contributors:
5+
# The contents of this file are subject to the Mozilla Public License
6+
# Version 1.1 (the "License"); you may not use this file except in
7+
# compliance with the License. You may obtain a copy of the License at
8+
# http://www.mozilla.org/MPL/
9+
#
10+
# Software distributed under the License is distributed on an "AS IS"
11+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing rights and limitations
13+
# under the License.
14+
#
15+
# The Original Code is Komodo code.
16+
#
17+
# The Initial Developer of the Original Code is ActiveState Software Inc.
18+
# Portions created by ActiveState Software Inc are Copyright (C) 2004-2006
19+
# ActiveState Software Inc. All Rights Reserved.
20+
#
21+
# Portions created by German Mendez Bravo (Kronuz) are Copyright (C) 2017
22+
# German Mendez Bravo (Kronuz). All Rights Reserved.
23+
#
24+
# Contributor(s):
525
# Trent Mick ([email protected])
626
# German Mendez Bravo (Kronuz) ([email protected])
7-
27+
#
28+
# Alternatively, the contents of this file may be used under the terms of
29+
# either the GNU General Public License Version 2 or later (the "GPL"), or
30+
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31+
# in which case the provisions of the GPL or the LGPL are applicable instead
32+
# of those above. If you wish to allow use of your version of this file only
33+
# under the terms of either the GPL or the LGPL, and not to allow others to
34+
# use your version of this file under the terms of the MPL, indicate your
35+
# decision by deleting the provisions above and replace them with the notice
36+
# and other provisions required by the GPL or the LGPL. If you do not delete
37+
# the provisions above, a recipient may use your version of this file under
38+
# the terms of any one of the MPL, the GPL or the LGPL.
39+
#
40+
# ***** END LICENSE BLOCK *****
841
"""
942
ecmacile - a Code Intelligence Language Engine for the ECMAScript language
1043
@@ -915,7 +948,13 @@ def visit_ExportDefaultDeclaration(self, node):
915948
line = node.loc.start.line
916949
start = node.range[0]
917950
end = node.range[1]
918-
self._visitSimpleAssign(default, declaration, line, start, end)
951+
952+
if typ in (esprima.Syntax.Identifier, esprima.JSXSyntax.JSXIdentifier, esprima.Syntax.MemberExpression):
953+
extra_attributes = ["__no_defn__"]
954+
else:
955+
extra_attributes = []
956+
957+
self._visitSimpleAssign(default, declaration, line, start, end, extra_attributes=extra_attributes)
919958

920959
self.nsstack.pop()
921960

codeintel/codeintel2/lang_ecma.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
# Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
1919
# ActiveState Software Inc. All Rights Reserved.
2020
#
21+
# Portions created by German Mendez Bravo (Kronuz) are Copyright (C) 2017
22+
# German Mendez Bravo (Kronuz). All Rights Reserved.
23+
#
2124
# Contributor(s):
2225
# ActiveState Software Inc
26+
# German Mendez Bravo (Kronuz) ([email protected])
2327
#
2428
# Alternatively, the contents of this file may be used under the terms of
2529
# either the GNU General Public License Version 2 or later (the "GPL"), or

codeintel/codeintel2/tree_ecma.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
# Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
1919
# ActiveState Software Inc. All Rights Reserved.
2020
#
21+
# Portions created by German Mendez Bravo (Kronuz) are Copyright (C) 2017
22+
# German Mendez Bravo (Kronuz). All Rights Reserved.
23+
#
2124
# Contributor(s):
2225
# ActiveState Software Inc
26+
# German Mendez Bravo (Kronuz) ([email protected])
2327
#
2428
# Alternatively, the contents of this file may be used under the terms of
2529
# either the GNU General Public License Version 2 or later (the "GPL"), or

0 commit comments

Comments
 (0)