Skip to content

Don't understand reason for code in SQLitePlugin.js #16

Description

@mineshaftgap
    openDatabase: function(dbPath, version, displayName, estimatedSize, creationCallback, errorCallback) {
      if (version == null) version = null;
      if (displayName == null) displayName = null;
      if (estimatedSize == null) estimatedSize = 0;
      if (creationCallback == null) creationCallback = null;
      if (errorCallback == null) errorCallback = null;
      return new SQLitePlugin(dbPath, creationCallback, errorCallback);
    }

Since these variable are local, none of them are passed on and most are set to null if they equal null, this makes no sense to me, is this possibly left from some legacy reason? It seems that it should be simply:

    openDatabase: function(dbPath, version, displayName, estimatedSize, creationCallback, errorCallback) {
      return new SQLitePlugin(dbPath, creationCallback, errorCallback);
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions