Skip to content

feat: Add Google Apps Script compatibility runner #1418

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chad-loder
Copy link

This adds a standalone Google Apps Script runner (tests/compat/gas-runner.gs) to test the native feature support of the GAS V8 runtime environment against the checks defined in tests/compat/tests.js.

Motivation:

Provide a way to easily check the native ES feature compatibility of the Google Apps Script environment, which is relevant for understanding potential polyfill needs when using core-js within GAS projects.

How it Works:

  • The script is designed to be pasted into the script editor bound to a Google Sheet.
  • It fetches a specific, commit-pinned version of tests/compat/tests.js from the core-js repository.
  • It validates the fetched file's hash against an expected value.
  • It modifies the fetched code slightly to ensure compatibility with the GAS execution environment.
  • It evaluates the code and executes the test functions defined within it.
  • It logs the results (pass/fail for each native feature check) to a new timestamped sheet within the active Google Sheet, applying conditional formatting for readability.

Usage:

Instructions for use are included in the comment header within the gas-runner.gs file.

Limitations:

  • This script only tests the native environment's support for features checked by tests.js. It does not load or test the core-js polyfills themselves.
  • It relies on the GAS environment having network access to raw.githubusercontent.com.

This runner can help generate compatibility data specific to the Google Apps Script platform.

@chad-loder
Copy link
Author

Results from running the GAS runner script:

Summary: 283 Passed, 129 Failed (as per CSV file). Actual pass/fail counts are reflected in the table above.

@chad-loder
Copy link
Author

chad-loder commented Apr 19, 2025

Results from running this GAS runner script in the Google Apps Script runtime.
Passed: 283, Failed: 129

Test Name Pass/Fail Details
es.symbol
es.symbol.constructor
es.symbol.description
es.symbol.async-iterator
es.symbol.for
es.symbol.has-instance
es.symbol.is-concat-spreadable
es.symbol.iterator
es.symbol.key-for
es.symbol.match
es.symbol.match-all
es.symbol.replace
es.symbol.search
es.symbol.species
es.symbol.split
es.symbol.to-primitive
es.symbol.to-string-tag
es.symbol.unscopables
es.error.cause
es.error.to-string
es.aggregate-error.constructor
es.aggregate-error.cause
es.array.at
es.array.concat
es.array.copy-within
es.array.every
es.array.fill
es.array.filter
es.array.find
es.array.find-index
es.array.find-last
es.array.find-last-index
es.array.flat
es.array.flat-map
es.array.for-each
es.array.from
es.array.includes
es.array.index-of
es.array.is-array
es.array.iterator
es.array.join
es.array.last-index-of
es.array.map
es.array.of
es.array.push
es.array.reduce
es.array.reduce-right
es.array.reverse
es.array.slice
es.array.some
es.array.sort
es.array.species
es.array.splice
es.array.to-reversed
es.array.to-sorted
es.array.to-spliced
es.array.unscopables.flat
es.array.unscopables.flat-map
es.array.unshift
es.array.with
es.array-buffer.constructor
es.array-buffer.is-view
es.array-buffer.slice
es.array-buffer.detached
es.array-buffer.transfer
es.array-buffer.transfer-to-fixed-length
es.data-view.constructor
es.data-view.get-float16
es.data-view.set-float16
es.date.get-year
es.date.now
es.date.set-year
es.date.to-gmt-string
es.date.to-iso-string
es.date.to-json
es.date.to-primitive
es.date.to-string
es.escape
es.function.bind
es.function.has-instance
es.function.name
es.global-this
es.iterator.constructor
es.iterator.drop
es.iterator.every
es.iterator.filter
es.iterator.find
es.iterator.flat-map
es.iterator.for-each
es.iterator.from
es.iterator.map
es.iterator.reduce
es.iterator.some
es.iterator.take
es.iterator.to-array
es.json.stringify
es.json.to-string-tag
es.map.constructor
es.map.group-by
es.math.acosh
es.math.asinh
es.math.atanh
es.math.cbrt
es.math.clz32
es.math.cosh
es.math.expm1
es.math.fround
es.math.f16round
es.math.hypot
es.math.imul
es.math.log10
es.math.log1p
es.math.log2
es.math.sign
es.math.sinh
es.math.tanh
es.math.to-string-tag
es.math.trunc
es.number.constructor
es.number.epsilon
es.number.is-finite
es.number.is-integer
es.number.is-nan
es.number.is-safe-integer
es.number.max-safe-integer
es.number.min-safe-integer
es.number.parse-float
es.number.parse-int
es.number.to-exponential
es.number.to-fixed
es.number.to-precision
es.object.assign
es.object.create
es.object.define-getter
es.object.define-properties
es.object.define-property
es.object.define-setter
es.object.entries
es.object.freeze
es.object.from-entries
es.object.get-own-property-descriptor
es.object.get-own-property-descriptors
es.object.get-own-property-names
es.object.get-own-property-symbols
es.object.get-prototype-of
es.object.group-by
es.object.has-own
es.object.is
es.object.is-extensible
es.object.is-frozen
es.object.is-sealed
es.object.keys
es.object.lookup-getter
es.object.lookup-setter
es.object.prevent-extensions
es.object.proto
es.object.seal
es.object.set-prototype-of
es.object.to-string
es.object.values
es.parse-float
es.parse-int
es.promise
es.promise.constructor
es.promise.all
es.promise.all-settled
es.promise.any
es.promise.catch
es.promise.finally
es.promise.race
es.promise.reject
es.promise.resolve
es.promise.try
es.promise.with-resolvers
es.reflect.apply
es.reflect.construct
es.reflect.define-property
es.reflect.delete-property
es.reflect.get
es.reflect.get-own-property-descriptor
es.reflect.get-prototype-of
es.reflect.has
es.reflect.is-extensible
es.reflect.own-keys
es.reflect.prevent-extensions
es.reflect.set
es.reflect.set-prototype-of
es.reflect.to-string-tag
es.regexp.constructor
es.regexp.escape RegExp.escape is not a function
es.regexp.dot-all
es.regexp.exec
es.regexp.flags
es.regexp.sticky
es.regexp.test
es.regexp.to-string
es.set.constructor
es.set.difference.v2
es.set.intersection.v2
es.set.is-disjoint-from.v2
es.set.is-subset-of.v2
es.set.is-superset-of.v2
es.set.symmetric-difference.v2
es.set.union.v2
es.string.at-alternative
es.string.code-point-at
es.string.ends-with
es.string.from-code-point
es.string.includes
es.string.is-well-formed
es.string.iterator
es.string.match
es.string.match-all
es.string.pad-end
es.string.pad-start
es.string.raw
es.string.repeat
es.string.replace
es.string.replace-all
es.string.search
es.string.split
es.string.starts-with
es.string.substr
es.string.to-well-formed
es.string.trim
es.string.trim-end
es.string.trim-left
es.string.trim-right
es.string.trim-start
es.string.anchor
es.string.big
es.string.blink
es.string.bold
es.string.fixed
es.string.fontcolor
es.string.fontsize
es.string.italics
es.string.link
es.string.small
es.string.strike
es.string.sub
es.string.sup
es.typed-array.float32-array
es.typed-array.float64-array
es.typed-array.int8-array
es.typed-array.int16-array
es.typed-array.int32-array
es.typed-array.uint8-array
es.typed-array.uint8-clamped-array
es.typed-array.uint16-array
es.typed-array.uint32-array
es.typed-array.at
es.typed-array.copy-within
es.typed-array.every
es.typed-array.fill
es.typed-array.filter
es.typed-array.find
es.typed-array.find-index
es.typed-array.find-last
es.typed-array.find-last-index
es.typed-array.for-each
es.typed-array.from
es.typed-array.includes
es.typed-array.index-of
es.typed-array.iterator
es.typed-array.join
es.typed-array.last-index-of
es.typed-array.map
es.typed-array.of
es.typed-array.reduce
es.typed-array.reduce-right
es.typed-array.reverse
es.typed-array.set
es.typed-array.slice
es.typed-array.some
es.typed-array.sort
es.typed-array.subarray
es.typed-array.to-locale-string
es.typed-array.to-string
es.typed-array.to-reversed
es.typed-array.to-sorted
es.typed-array.with
es.unescape
es.weak-map.constructor
es.weak-set.constructor
esnext.suppressed-error.constructor
esnext.array.from-async
esnext.array.filter-reject
esnext.array.is-template-object
esnext.array.unique-by
esnext.async-disposable-stack.constructor
esnext.async-iterator.constructor
esnext.async-iterator.async-dispose AsyncIterator is not defined
esnext.async-iterator.drop AsyncIterator is not defined
esnext.async-iterator.every AsyncIterator is not defined
esnext.async-iterator.filter AsyncIterator is not defined
esnext.async-iterator.find AsyncIterator is not defined
esnext.async-iterator.flat-map AsyncIterator is not defined
esnext.async-iterator.for-each AsyncIterator is not defined
esnext.async-iterator.from AsyncIterator is not defined
esnext.async-iterator.map AsyncIterator is not defined
esnext.async-iterator.reduce AsyncIterator is not defined
esnext.async-iterator.some AsyncIterator is not defined
esnext.async-iterator.take AsyncIterator is not defined
esnext.async-iterator.to-array AsyncIterator is not defined
esnext.composite-key compositeKey is not defined
esnext.composite-symbol compositeSymbol is not defined
esnext.data-view.get-uint8-clamped
esnext.data-view.set-uint8-clamped
esnext.disposable-stack.constructor
esnext.error.is-error
esnext.function.demethodize
esnext.function.is-callable
esnext.function.is-constructor
esnext.function.metadata
esnext.iterator.concat
esnext.iterator.dispose
esnext.iterator.range
esnext.iterator.to-async
esnext.json.is-raw-json
esnext.json.parse
esnext.json.raw-json
esnext.map.delete-all
esnext.map.every
esnext.map.filter
esnext.map.find
esnext.map.find-key
esnext.map.from
esnext.map.get-or-insert
esnext.map.get-or-insert-computed
esnext.map.includes
esnext.map.key-by
esnext.map.key-of
esnext.map.map-keys
esnext.map.map-values
esnext.map.merge
esnext.map.of
esnext.map.reduce
esnext.map.some
esnext.map.update
esnext.math.clamp
esnext.math.deg-per-rad
esnext.math.degrees
esnext.math.fscale
esnext.math.rad-per-deg
esnext.math.radians
esnext.math.scale
esnext.math.signbit
esnext.math.sum-precise
esnext.number.from-string
esnext.set.add-all
esnext.set.delete-all
esnext.set.every
esnext.set.filter
esnext.set.find
esnext.set.from
esnext.set.join
esnext.set.map
esnext.set.of
esnext.set.reduce
esnext.set.some
esnext.string.code-points
esnext.string.cooked
esnext.string.dedent
esnext.symbol.async-dispose
esnext.symbol.custom-matcher
esnext.symbol.dispose
esnext.symbol.is-registered-symbol
esnext.symbol.is-well-known-symbol
esnext.symbol.metadata
esnext.symbol.observable
esnext.typed-array.filter-reject
esnext.typed-array.unique-by
esnext.uint8-array.from-base64
esnext.uint8-array.from-hex
esnext.uint8-array.set-from-base64
esnext.uint8-array.set-from-hex
esnext.uint8-array.to-base64
esnext.uint8-array.to-hex
esnext.weak-map.delete-all
esnext.weak-map.get-or-insert
esnext.weak-map.get-or-insert-computed
esnext.weak-map.from
esnext.weak-map.of
esnext.weak-set.add-all
esnext.weak-set.delete-all
esnext.weak-set.from
esnext.weak-set.of
web.atob atob is not defined
web.btoa
web.clear-immediate setImmediate is not defined
web.dom-collections.for-each
web.dom-collections.iterator
web.dom-exception.constructor DOMException is not defined
web.dom-exception.stack DOMException is not defined
web.dom-exception.to-string-tag
web.immediate setImmediate is not defined
web.queue-microtask Cannot read properties of undefined (reading 'value')
web.self self is not defined
web.set-immediate setImmediate is not defined
web.set-interval
web.set-timeout
web.structured-clone structuredClone is not defined
web.timers
web.url.constructor URL is not defined
web.url.can-parse URL is not defined
web.url.parse URL is not defined
web.url.to-json URL is not defined
web.url-search-params.constructor URL is not defined
web.url-search-params.delete URL is not defined
web.url-search-params.has URL is not defined
web.url-search-params.size URL is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant