Skip to content
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

Remove deprecated Ref suffix #51

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Benchmark {
}

let title: String
let runner: JSFunctionRef = JSObjectRef.global.benchmarkRunner.function!
let runner = JSObject.global.benchmarkRunner.function!

func testSuite(_ name: String, _ body: @escaping () -> Void) {
let jsBody = JSClosure { arguments -> JSValue in
Expand Down
6 changes: 3 additions & 3 deletions IntegrationTests/TestSuites/Sources/BenchmarkTests/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let serialization = Benchmark("Serialization")
let swiftInt: Double = 42
serialization.testSuite("Swift Int to JavaScript") {
let jsNumber = JSValue.number(swiftInt)
let object = JSObjectRef.global
let object = JSObject.global
for i in 0 ..< 100 {
object["numberValue\(i)"] = jsNumber
}
Expand All @@ -14,15 +14,15 @@ serialization.testSuite("Swift Int to JavaScript") {
let swiftString = "Hello, world"
serialization.testSuite("Swift String to JavaScript") {
let jsString = JSValue.string(swiftString)
let object = JSObjectRef.global
let object = JSObject.global
for i in 0 ..< 100 {
object["stringValue\(i)"] = jsString
}
}

let objectHeap = Benchmark("Object heap")

let global = JSObjectRef.global
let global = JSObject.global
let Object = global.Object.function!
global.objectHeapDummy = .object(Object.new())
objectHeap.testSuite("Increment and decrement RC") {
Expand Down
4 changes: 2 additions & 2 deletions Sources/JavaScriptKit/BasicObjects/JSTypedArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ extension UInt32: TypedArrayElement {

// FIXME: Support passing BigInts across the bridge
//extension Int64: TypedArrayElement {
// public static var typedArrayClass: JSFunctionRef { JSObjectRef.global.BigInt64Array.function! }
// public static var typedArrayClass: JSFunction { JSObject.global.BigInt64Array.function! }
// public static var type: JavaScriptTypedArrayKind { .bigInt64 }
//}
//extension UInt64: TypedArrayElement {
// public static var typedArrayClass: JSFunctionRef { JSObjectRef.global.BigUint64Array.function! }
// public static var typedArrayClass: JSFunction { JSObject.global.BigUint64Array.function! }
// public static var type: JavaScriptTypedArrayKind { .bigUint64 }
//}

Expand Down