Repository: common-workflow-language/cwltool

Issue:
cwltool fails to run with an input of record and an InlineJavascriptRequirement
`test.cwl`
```
cwlVersion: v1.0
class: CommandLineTool
requirements:
  - class: InlineJavascriptRequirement
baseCommand: ['echo']

inputs:
  - id: input
    type:
      type: record
      fields: []

outputs: []
```
fails with:
```
/Users/th10/checkouts/cwltool/venv/bin/cwltool 1.0.20180611202326
Resolved 'test.cwl' to 'file:///Users/th10/checkouts/cwltool/test.cwl'
I'm sorry, I couldn't load this CWL file.  The error was:
Traceback (most recent call last):
  File "/Users/th10/checkouts/cwltool/cwltool/main.py", line 527, in main
    job_script_provider, make_tool_kwds)
  File "/Users/th10/checkouts/cwltool/cwltool/load_tool.py", line 351, in make_tool
    job_script_provider=job_script_provider, **kwargs)
  File "/Users/th10/checkouts/cwltool/cwltool/workflow.py", line 51, in default_make_tool
    force_docker_pull, job_script_provider, **kwargs)
  File "/Users/th10/checkouts/cwltool/cwltool/command_line_tool.py", line 224, in __init__
    force_docker_pull, job_script_provider, **kwargs)
  File "/Users/th10/checkouts/cwltool/cwltool/process.py", line 568, in __init__
    validate_js_expressions(cast(CommentedMap, toolpath_object), self.doc_schema.names[toolpath_object["class"]], validate_js_options)
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 181, in validate_js_expressions
    expressions = get_expressions(tool, schema)
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 76, in get_expressions
    SourceLine(tool, schema_field.name)
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 62, in get_expressions
    map(lambda x: get_expressions(x[1], schema.items, SourceLine(tool, x[0])), enumerate(tool))  # type: ignore # https://github.com/python/mypy/issues/4679
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 62, in <lambda>
    map(lambda x: get_expressions(x[1], schema.items, SourceLine(tool, x[0])), enumerate(tool))  # type: ignore # https://github.com/python/mypy/issues/4679
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 76, in get_expressions
    SourceLine(tool, schema_field.name)
  File "/Users/th10/checkouts/cwltool/cwltool/validate_js.py", line 55, in get_expressions
    assert valid_schema is not None
AssertionError
```
as https://github.com/common-workflow-language/cwltool/blob/886a6ac41c685f20d39e352f9c657e59f3312265/cwltool/validate_js.py#L51-L52 is parsing using strict validation and earlier parts of the code are setting the "name" attribute of records and arrays. This will also produce an error when someone is not strict validating a CWL script and a CWL warning would appear. A quick fix for this would be to get rid of the `strict=True` parameter.


Discussion:

Resolving patch:
diff --git a/cwltool/validate_js.py b/cwltool/validate_js.py
--- a/cwltool/validate_js.py
+++ b/cwltool/validate_js.py
@@ -48,7 +48,7 @@ def get_expressions(tool,             # type: Union[CommentedMap, Any]
         for possible_schema in schema.schemas:
             if is_expression(tool, possible_schema):
                 return [(tool, source_line)]
-            elif validate_ex(possible_schema, tool, strict=True, raise_ex=False,
+            elif validate_ex(possible_schema, tool, raise_ex=False,
                              logger=_logger_validation_warnings):
                 valid_schema = possible_schema
 


Test patch: