Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add JSBridgedType and JSBridgedClass #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
j-f1 merged 26 commits into swiftwasm:master from j-f1:webidl
Sep 18, 2020
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b123600
Changes related to WebIDL support.
mjburghard Jun 7, 2020
e6b6705
Rename constructor
j-f1 Aug 2, 2020
5982bef
wip
j-f1 Aug 3, 2020
a5ce5e4
Add JSAbstractBridgedType
j-f1 Aug 4, 2020
0f79f43
More updates
j-f1 Aug 4, 2020
fbf9f76
Move & rename JS*BridgedType
j-f1 Aug 14, 2020
e31a989
wip
j-f1 Aug 14, 2020
e4d657e
Update JSTypedArray.swift
j-f1 Aug 14, 2020
c07db3d
Update JSTypedArray.swift
j-f1 Aug 14, 2020
be1f916
Update JSTypedArray.swift
j-f1 Aug 14, 2020
ba3316e
Update JSTypedArray.swift
j-f1 Aug 14, 2020
5fe4b96
Allow JSBridgedType (but not JSBridgedClass) to hold non-objects
j-f1 Aug 14, 2020
b62b78e
Make JS{Array,Date,Error} conform to JSBridgedClass
j-f1 Sep 15, 2020
8b181c7
Clean up AnyJSValueConvertible
j-f1 Sep 15, 2020
de5f52e
Docs for JSTypedArray
j-f1 Sep 15, 2020
479ad20
Docs for JSValueCoable-adjacent types
j-f1 Sep 15, 2020
b4edc19
Update based on review suggestions
j-f1 Sep 16, 2020
cabda58
Remove AnyJSValueConvertible
j-f1 Sep 16, 2020
d0da61a
Merge branch 'master' into webidl
j-f1 Sep 16, 2020
e19788a
Remove is* helpers
j-f1 Sep 16, 2020
ff1f4ac
withCompatibleObject → unsafelyWrapping
j-f1 Sep 17, 2020
c74e3d1
Apply suggestions from code review
j-f1 Sep 17, 2020
ed9f8d4
Rename Object and Array constructors
j-f1 Sep 17, 2020
29a30e7
Document & fix the behavior of isInstanceOf
j-f1 Sep 17, 2020
4429d88
Merge branch 'master' into webidl
j-f1 Sep 17, 2020
767d05d
Fix indent
j-f1 Sep 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add JSAbstractBridgedType
  • Loading branch information
j-f1 committed Sep 15, 2020
commit a5ce5e40eb8e88dc051b0b1034a61820ff076791
12 changes: 8 additions & 4 deletions Sources/JavaScriptKit/JSValueConvertible.swift
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import _CJavaScriptKit

public protocol JSBridgedType: JSValueCodable, CustomStringConvertible {
static var classRef: JSFunction { get }

// Use this protocol when your type has no single JavaScript class.
// For example, a union type of multiple classes.
public protocol JSAbstractBridgedType: JSValueCodable, CustomStringConvertible {
var objectRef: JSObject { get }
init(objectRef: JSObject)
}

extension JSBridgedType {
extension JSAbstractBridgedType {
public var description: String {
return objectRef.toString!().fromJSValue()!
}
}

public protocol JSBridgedType: JSAbstractBridgedType {
static var classRef: JSFunction { get }
}

public protocol JSValueConvertible {
func jsValue() -> JSValue
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /