r')\s*\{.*(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}') invalid_type_designator_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*.*(?<![{: ])([?!])=?\}') invalid_non_object_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.*(![a-z]+)[^/]*\}') error_warning_regex = re.compile(r'WARNING|ERROR') loaded_css_regex = re.compile( r'(?:registerRequiredCSS|WebInspector\.View\.createStyleElement)\s*\(\s*"(.+)"\s*\)' ) java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)') errors_found = False generate_protocol_externs.generate_protocol_externs( protocol_externs_file, path.join(devtools_path, 'protocol.json')) # Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python. def which(program): def is_exe(fpath): return path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = path.split(program) if fpath: if is_exe(program): return program else: for part in os.environ["PATH"].split(os.pathsep): part = part.strip('"') exe_file = path.join(part, program)
import os import os.path import generate_protocol_externs import re import shutil import sys import tempfile scripts_path = os.path.dirname(os.path.abspath(__file__)) devtools_path = os.path.dirname(scripts_path) inspector_path = os.path.dirname(devtools_path) + "/core/inspector" devtools_frontend_path = devtools_path + "/front_end" protocol_externs_path = devtools_frontend_path + "/protocol_externs.js" webgl_rendering_context_idl_path = os.path.dirname(devtools_path) + "/core/html/canvas/WebGLRenderingContext.idl" generate_protocol_externs.generate_protocol_externs(protocol_externs_path, devtools_path + "/protocol.json") jsmodule_name_prefix = "jsmodule_" modules = [ { "name": "common", "dependencies": [], "sources": [ "Color.js", "DOMExtension.js", "Object.js", "ParsedURL.js", "Progress.js", "Settings.js", "UIString.js", "UserMetrics.js",
scripts_path = path.dirname(path.abspath(__file__)) devtools_path = path.dirname(scripts_path) inspector_path = path.join(path.dirname(devtools_path), "core", "inspector") devtools_frontend_path = path.join(devtools_path, "front_end") global_externs_file = path.join(devtools_frontend_path, "externs.js") protocol_externs_file = path.join(devtools_frontend_path, "protocol_externs.js") webgl_rendering_context_idl_path = path.join(path.dirname(devtools_path), "core", "html", "canvas", "WebGLRenderingContextBase.idl") injected_script_source_name = path.join(inspector_path, "InjectedScriptSource.js") canvas_injected_script_source_name = path.join(inspector_path, "InjectedScriptCanvasModuleSource.js") closure_compiler_jar = path.join(scripts_path, "closure", "compiler.jar") closure_runner_jar = path.join(scripts_path, "compiler-runner", "closure-runner.jar") jsdoc_validator_jar = path.join(scripts_path, "jsdoc-validator", "jsdoc-validator.jar") java_exec = "java -Xms1024m -server -XX:+TieredCompilation" generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(devtools_path, "protocol.json")) jsmodule_name_prefix = "jsmodule_" frontend_modules_name = "frontend_modules.json" runtime_module_name = "_runtime" module_initializer_name = "_module.js" def log_error(message): print "ERROR: " + message def error_excepthook(exctype, value, traceback): print "ERROR:" sys.__excepthook__(exctype, value, traceback) sys.excepthook = error_excepthook
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import os.path import generate_protocol_externs inspector_path = "Source/WebCore/inspector" inspector_frontend_path = inspector_path + "/front-end" generate_protocol_externs.generate_protocol_externs(inspector_frontend_path + "/protocol-externs.js", inspector_path + "/Inspector.json") externs = ["externs.js", "protocol-externs.js"] jsmodule_name_prefix = "jsmodule_" modules = [ { "target_name": "util", "dependencies": [], "sources": [ "DOMExtension.js", "utilities.js", "treeoutline.js", ] }, { "target_name": "common",
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import os.path import generate_protocol_externs import shutil import sys import tempfile scripts_path = os.path.dirname(os.path.abspath(__file__)) devtools_path = os.path.dirname(scripts_path) inspector_path = os.path.dirname(devtools_path) + "/WebCore/inspector" devtools_frontend_path = devtools_path + "/front_end" protocol_externs_path = devtools_frontend_path + "/protocol_externs.js" generate_protocol_externs.generate_protocol_externs(protocol_externs_path, devtools_path + "/protocol.json") jsmodule_name_prefix = "jsmodule_" modules = [ { "name": "common", "dependencies": [], "sources": [ "Color.js", "DOMExtension.js", "Object.js", "ParsedURL.js", "Progress.js", "Settings.js", "UIString.js", "UserMetrics.js",
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import os.path import generate_protocol_externs import shutil import sys import tempfile inspector_path = "Source/WebCore/inspector" inspector_frontend_path = inspector_path + "/front-end" protocol_externs_path = inspector_frontend_path + "/protocol-externs.js" generate_protocol_externs.generate_protocol_externs( protocol_externs_path, inspector_path + "/Inspector.json") jsmodule_name_prefix = "jsmodule_" modules = [ { "name": "common", "dependencies": [], "sources": [ "Color.js", "DOMExtension.js", "Object.js", "ParsedURL.js", "Progress.js", "Settings.js", "UIString.js",
runtime_module_name = '_runtime' type_checked_jsdoc_tags_list = ['param', 'return', 'type', 'enum'] type_checked_jsdoc_tags_or = '|'.join(type_checked_jsdoc_tags_list) # Basic regex for invalid JsDoc types: an object type name ([A-Z][_A-Za-z0-9.]+[A-Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property). invalid_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.*(?<![!?:._A-Za-z0-9])([A-Z][_A-Za-z0-9.]+[A-Za-z0-9])[^/]*\}') invalid_type_designator_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*.*(?<![{: ])([?!])=?\}') invalid_non_object_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.*(![a-z]+)[^/]*\}') error_warning_regex = re.compile(r'WARNING|ERROR') loaded_css_regex = re.compile(r'(?:registerRequiredCSS|WebInspector\.View\.createStyleElement)\s*\(\s*"(.+)"\s*\)') java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)') errors_found = False generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(inspector_path, 'browser_protocol.json'), path.join(v8_inspector_path, 'js_protocol.json')) # Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python. def which(program): def is_exe(fpath): return path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = path.split(program) if fpath: if is_exe(program): return program else: for part in os.environ["PATH"].split(os.pathsep): part = part.strip('"') exe_file = path.join(part, program)
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import os.path import generate_protocol_externs import shutil import sys import tempfile inspector_path = "Source/WebCore/inspector" inspector_frontend_path = inspector_path + "/front-end" protocol_externs_path = inspector_frontend_path + "/protocol-externs.js" generate_protocol_externs.generate_protocol_externs(protocol_externs_path, inspector_path + "/Inspector.json") jsmodule_name_prefix = "jsmodule_" modules = [ { "name": "common", "dependencies": [], "sources": [ "Color.js", "DOMExtension.js", "Object.js", "ParsedURL.js", "Progress.js", "Settings.js", "UIString.js", "UserMetrics.js",
java_required_major = 1 java_required_minor = 7 v8_inspector_path = path.dirname(path.dirname(path.abspath(__file__))) protocol_externs_file = path.join(v8_inspector_path, 'protocol_externs.js') injected_script_source_name = path.join(v8_inspector_path, 'injected-script-source.js') injected_script_externs_file = path.join(v8_inspector_path, 'injected_script_externs.js') debugger_script_source_name = path.join(v8_inspector_path, 'debugger-script.js') debugger_script_externs_file = path.join(v8_inspector_path, 'debugger_script_externs.js') generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(v8_inspector_path, 'js_protocol.json')) error_warning_regex = re.compile(r'WARNING|ERROR') closure_compiler_jar = path.join(v8_inspector_path, 'build', 'closure-compiler', 'closure-compiler.jar') common_closure_args = [ '--checks_only', '--warning_level', 'VERBOSE' ] # Error reporting and checking. errors_found = False def popen(arguments):
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import os.path import generate_protocol_externs import shutil import sys import tempfile inspector_path = "Source/WebCore/inspector" inspector_frontend_path = inspector_path + "/front-end" generate_protocol_externs.generate_protocol_externs( inspector_frontend_path + "/protocol-externs.js", inspector_path + "/Inspector.json") jsmodule_name_prefix = "jsmodule_" modules = [ { "name": "common", "dependencies": [], "sources": [ "Color.js", "DOMExtension.js", "Object.js", "ParsedURL.js", "Progress.js", "Settings.js",
invalid_type_designator_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*.*(?<![{: ])([?!])=?\}') invalid_non_object_type_regex = re.compile(r'@(?:' + type_checked_jsdoc_tags_or + r')\s*\{.*(![a-z]+)[^/]*\}') error_warning_regex = re.compile(r'WARNING|ERROR') loaded_css_regex = re.compile( r'(?:registerRequiredCSS|WebInspector\.View\.createStyleElement)\s*\(\s*"(.+)"\s*\)' ) java_build_regex = re.compile(r'^\w+ version "(\d+)\.(\d+)') errors_found = False generate_protocol_externs.generate_protocol_externs( protocol_externs_file, path.join(inspector_path, 'browser_protocol.js'), path.join(v8_inspector_path, 'v8_protocol.js')) # Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python. def which(program): def is_exe(fpath): return path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fname = path.split(program) if fpath: if is_exe(program): return program else: for part in os.environ["PATH"].split(os.pathsep): part = part.strip('"')