Skip to content

Javascript: new File(bits, name[, options]) constructor not implemented #202

Description

@twendelmuth

Anyone calling new File(bits, name) (see: https://developer.mozilla.org/en-US/docs/Web/API/File/File) in javascript code will seen unexpected behavior.
The first issue is that most calls on the object will fail with an NullPointerException (getName(), getLastModified(), getSize() all require the underlying file_ to be not null).

Therefore the following test will fail:

    @Test
    @Alerts({"myfilename", "application/octet-stream", "1000", "0"})
    @NotYetImplemented(IE)
    public void fileConstructor() throws Exception {

		final String html = "<html><head><script>\n" + "	function test() {\n"
				+ "		var newFile = new File([], 'myfilename', {type: 'application/octet-stream', lastModified: '1000'});"
				+ "     alert(newFile.name);"
				+ "     alert(newFile.type);"
				+ "     alert(newFile.lastModified);"
				+ "     alert(newFile.size);"
				+ " } "
				+ "</script></head><body onload='test()'>\n"
				+ "</body>\n" + "</html>";
		loadPageWithAlerts2(html);
	}

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions