Skip to content

Instantly share code, notes, and snippets.

@jschaf
Last active January 22, 2017 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jschaf/8614760290a95551a905d07107cfd7e7 to your computer and use it in GitHub Desktop.
Save jschaf/8614760290a95551a905d07107cfd7e7 to your computer and use it in GitHub Desktop.
/bazel-bazel_externs
/bazel-bin
/bazel-genfiles
/bazel-out
/bazel-testlogs
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
# With the externs file as a source for the library
closure_js_library(
name = "foo",
srcs = [
"foo.js",
],
)
closure_js_binary(
name = "foo_bin",
entry_points = ["foo"],
deps = [
"//:foo",
],
)
/**
* @externs
*/
goog.module('foo');
function parseComment0() {
try {
throw new Error;
} catch (ex) {
return ex.message;
}
}
function parseComment1() {
try {
throw new Error;
} catch (ex) {
if (ex instanceof Error) return ex.message;
}
}
function parseComment2() {
try {
throw new Error;
} catch (ex) {
return /** @type {!Error} */ (ex).message;
}
}
function parseComment3() {
try {
throw new Error;
} catch (ex) {
const error = /** @type {!Error} */ (ex);
return error.message;
}
}
http_archive(
name = "io_bazel_rules_closure",
sha256 = "c104d30b4aaf23d72afe327b4478d1c08cf1ff75c6db2060682bb7ad0591e19b",
strip_prefix = "rules_closure-962d929bc769fc320dd395f54fef3e9db62c3920",
urls = [
"http://bazel-mirror.storage.googleapis.com/github.com/bazelbuild/rules_closure/archive/962d929bc769fc320dd395f54fef3e9db62c3920.tar.gz", # 2016-12-28
"https://github.com/bazelbuild/rules_closure/archive/962d929bc769fc320dd395f54fef3e9db62c3920.tar.gz",
],
)
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
closure_repositories()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment